GitHub is now used frequently, but he often encounters the following problems
For example, a branch B was fork from a project A, and there was a change in branch B. After a few days, the code in project A should have a lot of people commit changes and now want to pull the latest code to branch B. How do I do it? Buttons that do not see the response on the GitHub interface
Solution steps:
Suppose you fork the original address of the project is Urlrep, your own is urlyou
$ git remote add upstream Urlrep
# Your local origin should be with your remote, and the current local branch is master.
$ git fetch upstream
$ git merge Upstream/master #merge可能会有冲突, hand-resolved and commit
$ git push # push on your own fork
Then submit a pull request to the original project. I don't know if you want this ... I am now updating it in this way, directly using Git's bash;
Another, git fetch upstream's role:
git fetch: Branch from remote download. git fetch upstream
A:B, download a branch under the remote warehouse upstream to local, called B-branch. If you do not take the a:b parameter, the download may be called upstream/a (if Remote is a branch), and the remote branch will pass through Git
Branch-r view. The general practice is to git fetch upstream first
Master:tmp (Downloads the remote master to the local TMP branch first, and then Git diff
TMP look at the difference between local master and TMP, no problem then git the merge tmp. This is more secure than the direct git pull upstream.
The above is GitHub pull the latest code data collation, follow-up continue to supplement the relevant information, thank you for your support of this site!