Information Technology Reference
In-Depth Information
Because your local repository is a cloned original repository, the origin alias
points to the repository owned by the organization. You can fetch the latest updates
made by other developers with:
$ git fetch origin
As you know fetch doesn't move your local tracking branches. To merge the latest
revisions in your local master branch you would have to execute merge or rebase, for
example:
$ git rebase origin/master master
To make pushing to your fork easier you need to set an alias for this repository. The
command:
$ git remote add my git@github.com:your-github-username/
writers.git
defines an alias named my . Therefore, if you want to push to your fork you can use
commands such as:
$ git push my branch-name
$ git push my HEAD
The first command pushes the branch with the given name and the second pushes
your current branch.
When your branch with your contributions is available in your forked repository,
you can send a pull request.
I prefer to create a local repository stored on my machine by cloning an original
hosted by organization. Then the alias original is used to fetch the most recent contri-
butions made by others and my alias is used to push my new contributions to the
forked repository. But you can use the other setting as well. You can clone your fork
and define a new remote named upstream for an original repository hosted by organiza-
tion. Then you will use origin alias to push your contributions to your fork and the up-
stream alias to download the latest contributions. There is really no difference in these
two solutions other then renamed remotes.
Search WWH ::




Custom Search