Recent Changes - Search:

Basics

Languages

Tools

OS

Resources

PmWiki

pmwiki.org

edit SideBar

Git /

Merging

Merging is the act of taking the commits of another branch and bringing them into the active branch. The distinction is important: You do not merge your active branch into the other one.

In order to merge a branch into another, you need to first checkout the receiving branch. For example, if you want to merge your working branch into the main branch after completing a project, you want to be on the main branch. This can be done with

git checkout BranchToBeMergedInto
git merge BranchWithNewStuff

Merging always brings the changes from a branch to the branch where you are. Be careful to avoid using things the other way around.

Merging to a certain commit

It might be that a certain branch is going too far, from something that was interesting. In order to merge a branch, but only up to a certain commit, you can use that commit's hash:

git merge CommitHash

Edit - History - Print - Recent Changes - Search
Page last modified on September 10, 2015, at 05:49 PM