merge branch into develop code example

Example 1: git merge branch a to branch b

git checkout b				# b is checked out (b could be master for exampel)
git pull					# update local b
git merge a					# merge branch a into b
git push					# b changes on remote.

Example 2: how to merge git branch to master

git checkout master
git pull origin master
git merge test
git push origin master

Example 3: merge branch to branch

git checkout master
git merge new-branch
git push

Example 4: merge develop to branch

git checkout develop 
git pull 
git checkout branch-x
git rebase develop

Example 5: git merge branch to master

$ git checkout master
Switched to branch 'master'
$ git merge iss53
Merge made by the 'recursive' strategy.
index.html |    1 +
1 file changed, 1 insertion(+)

Example 6: git merge two branches

git checkout targetBranch
git merge sourceBranch

Tags:

Misc Example