- For remote names use
origin
andupstream
where it applies.
Following the Github Flow paradigm, in short:
- Each developer creates a fork of the repository to their own account.
- Names remotes: their own repository
origin
and the main repositoryupstream
. - Creates a new branch out of
upstream/master
or target upstream branch. - Works on the branch doing Atomic Commits.
- Pushes to origin often.
- When done performs a Pull Request to
upstream/master
or the target branch.- If an issue exists (like in most cases) then they are expected to attach the Pull Request onto that issue using HUB, here's how to do it.
To keep up with the master of the original repo use fetch
:
git fetch upstream
The upstream
remote refers to the repository that you want to send your Pull Request to. If you have write access on that repository then you don't need it. Otherwise you need to create it:
git remote add upstream [uri-of-repository]
To create a new fresh branch from the original (upstream) master:
git checkout upstream/master -b new-local-branch