15 | Merging Commits Between Branches |
You have to merge changes from another branch into your current
branch in order to be able to use them. The simplest way to do
this is through git merge
.
git merge
takes two options: the name of
the other branch you want to merge and the optional local branch
you want to merge into. You can leave off the current branch when
youâre merging changes into your current branch.
By default, git merge
commits the merged
changes if they can be successfully merged. You can short-circuit
this with the --no-commit
option.
This is useful when you want to review, and possibly edit, the
changes from the merge before making a commit.
We touched on how Git attempts to merge commits in the introduction to Part III. ...
Get Pragmatic Guide to Git now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.