How to merge a branch into master in Git
In this tutorial, we are going to learn about how to merge a branch into the master in Git.
Merging branch into master
Consider we have a two branches dev
, master
in our git repository and we need to merge the dev
branch into a master
.
- On the
dev
branch rungit merge master
command to check any merge conflicts with amaster
branch.
git merge master
- Now, change your current branch to master by running the following command.
git checkout master
- At final, run the
git merge dev
command to merge adev
branch into a master.
git merge dev
Note: In your case, the
dev
branch should be some other.