How to Merge a Local Git Branch with Master

A new branch from master is created, we call it test. There are several developers who either commit to master or create other branches and later merge into master. To merge the test branch with master you could use the following commands.

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

Here we first checkout the master branch and update it locally from our remote source. Then we merge our local test branch with our locally updated master branch. Finally we push the changes to the remote location.

Other related posts:
Git Delete a Local or Remote Branch
How to Clone a Git Repository into a Specific Folder?
Change the URI for a Remote Git Repository
How to Setup Aliases and Shortcuts for Git Commands
How to create a .gitignore file in Windows

This content has been helpful to you?

Thanks for contributing!

Yes No