diff options
| author | tekkub <tekkub@gmail.com> | 2009-07-14 15:38:32 -0600 |
|---|---|---|
| committer | tekkub <tekkub@gmail.com> | 2009-07-14 15:38:32 -0600 |
| commit | 1713fa0405c9987cd39a0958f4da36ee9e99727e (patch) | |
| tree | 89cd3d5b84fbbee0a9f7c001d340dce3a014da03 /_posts/2009-06-16-forking.textile | |
| parent | c1970c2e893b9c1859869adea6116e43157f8ce8 (diff) | |
Tweak to the forking guide
Diffstat (limited to '_posts/2009-06-16-forking.textile')
| -rw-r--r-- | _posts/2009-06-16-forking.textile | 9 |
1 files changed, 7 insertions, 2 deletions
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: +<pre>$ git fetch upstream master +$ git merge upstream/master</pre> + <pre>$ git pull upstream master</pre> -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. |
