How to Merge Branch into Master Branch

If you are working on your project and ready to merge your release branch into master (production) then you can follow the below steps in git command line,

Step 1: Make sure your code is committed on your release branch, of the feature branch that you are going to commit to master.

Step 2: Move current project to master branch
# git checkout master

Step 3: Merge your branch to master branch
# git merge release-branch

Step 4: Commit the branch into master branch
# git commit -a

❗️Though we do not encourage to make use of the words master/slave as we really care about Diversity and Inclusion, this article is just for demonstration purpose and encourage everyone to make use of alternate words for repos like production/staging

Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.