by Sai gowtham

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.

  1. On the dev branch run git merge master command to check any merge conflicts with a master branch.
git merge master
  1. Now, change your current branch to master by running the following command.
git checkout master
  1. At final, run the git merge dev command to merge a dev branch into a master.
git merge dev

Note: In your case, the dev branch should be some other.

Top Udemy Courses

JavaScript - The Complete Guide 2021 (Beginner + Advanced)
JavaScript - The Complete Guide 2021 (Beginner + Advanced)
64,026 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
152,857 students enrolled
48.5 hours of video content
View Course