From 1713fa0405c9987cd39a0958f4da36ee9e99727e Mon Sep 17 00:00:00 2001 From: tekkub Date: Tue, 14 Jul 2009 15:38:32 -0600 Subject: Tweak to the forking guide --- _posts/2009-06-16-forking.textile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '_posts') diff --git a/_posts/2009-06-16-forking.textile b/_posts/2009-06-16-forking.textile index 784cde1..75299bb 100644 --- a/_posts/2009-06-16-forking.textile +++ b/_posts/2009-06-16-forking.textile @@ -35,10 +35,15 @@ _Note that some projects do not accept pull requests. Make sure you submit your h3. Pulling in upstream changes -Some time has passed, the upstream repo has changed and you want to update your fork before you submit a new patch. +Some time has passed, the upstream repo has changed and you want to update your fork before you submit a new patch. There are two ways to do this: +
$ git fetch upstream master
+$ git merge upstream/master
+
$ git pull upstream master
-This command does two things, @git fetch upstream master@ to update your local tracking branch, then @git merge upstream/master@ to bring the changes into your currently checked out branch. If you have local commits that are not in the upstream branch, a normal merge will occur. If your local commits are in the upstream branch, a fast-forward merge will be done, moving your local branch to the same commit as upstream/master. You may have to resolve merge conflicts if there are any. +@git pull@ is a more direct way, but the merge it performs can be confusing if the user doesn't expect it and a merge conflict results. @git fetch@ will also grab all branches, where @git pull@ will only grab the one specified. + +If you have local commits that are not in the upstream branch, a normal merge will occur. If your local commits are in the upstream branch, a fast-forward merge will be done, moving your local branch to the same commit as upstream/master. If both repos have edits to the same location in the same file, you may run into a merge conflict. Conflicts must be resolved by hand and a commit made to complete the merge. Now that your local branch has been updated, you can commit, push, and send a pull request. -- cgit v1.3.1