...
Code Block | ||
---|---|---|
| ||
# retrieve the updates from the upstream repository $ git fetch upstream -p # switch to the master branch $ git checkout master # rebase your master branch upon the upstream master # this rewrites history as if you had made your local changes upon the latest and greatest # WARNING: DO NOT DO THIS UNLESS YOU UNDERSTAND WHAT IT MEANS TO REBASE # In particular, if you've shared your local master branch with others, you *might* # want to avoid rebasing so as to avoid the inconvenience of changes to a shared history. # In this as in many things, effective communication and shared expectations are essential. # Littering your history with merge commits has a noise cost totoo. It's probably worth it to rebase. # If you can't use rebase, instead do git merge upstream/master $ git rebase upstream/master # now you're ready to update your fork $ git push origin master |
...