I then made some changes in a new branch on my_github/the_project repo. git
I then added and committed the changes and pushed to my github repo and submitted a pull request. github
The owner has received my request and would like me to "rebase onto master" to get the latest changes. How do I do this? post
Initially I thought I could just git fetch and rebase master from within my current branch (as most posts I found advise...), but git fetch didn't do anything. Now I've realized that it is presumably because I'm still fetching from my_ github/repo clone (it's my name in the remotes after all) which hasn't yet got the new changes in master from the github source owner. fetch
I think what I probably need to do is "refresh" my fork so that my fork's master is up-to-date andthen I can fetch that master and then rebase on to that master? this
If this is the case how can I do that refresh of my forks master? If not how else? spa
Should I add a remote for the original upstream repository and use that to rebase with (locally)? Is this the preferred method? code
git checkout master # Make sure you are in master git remote add author original_repo_that_you_forked_from # Note: This is in the format git@github.com:authors_name/repo_name.git # Only needs definition once, future fetches then use it. git fetch author git status # make sure you are in the master branch for the following merge git merge author/master # i.e. 'into' your master branch git checkout your-branch git rebase master # Now get those changes into your branch. git push origin your_branch # You can also use `-f` if necessary and `--all`
(sorry, I might not have the syntax exactly right) orm
原文:http://stackoverflow.com/questions/19884206/git-update-forks-master-rebase-my-branch-onto-it github自帶的幫助(排版很nice:) https://help.github.com/articles/syncing-a-fork/