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 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 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 JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
130,921 students enrolled
21 hours of video content
View Course