Skip to content

Commit

Permalink
Merge pull request progit#153 from mbolivar/fix-subtree-merge
Browse files Browse the repository at this point in the history
Improve subtree merge command line.
  • Loading branch information
ben committed Nov 27, 2014
2 parents f6593ca + 3d1b9aa commit b5f19d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions book/07-git-tools/sections/subtree-merges.asc
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ $ git pull
----

Then, we can merge those changes back into our `master` branch.
We can use `git merge -s subtree` and it will work fine; but Git will also merge the histories together, which we probably don’t want.
To pull in the changes and prepopulate the commit message, use the `--squash` and `--no-commit` options as well as the `-s subtree` strategy option:
To pull in the changes and prepopulate the commit message, use the `--squash` and `--no-commit` options, as well as the recursive merge strategy's `-Xsubtree` option. (The recursive strategy is the default here, but we include it for clarity.)

[source,console]
----
$ git checkout master
$ git merge --squash -s subtree --no-commit rack_branch
$ git merge --squash -s recursive -Xsubtree=rack --no-commit rack_branch
Squash commit -- not updating HEAD
Automatic merge went well; stopped before committing as requested
----
Expand Down

0 comments on commit b5f19d5

Please sign in to comment.