Tech Junkie Blog - Real World Tutorials, Happy Coding!: git & github : Merge Branch Into Master Branch

Wednesday, September 4, 2019

git & github : Merge Branch Into Master Branch

In a typical git scenario you would have a new branch for developers to work on, the when he or she is done. You do your code reviews and what not.  After you are satisfied with the results you would want to merge the new branch into the master branch.

In this post I am going to show you how to merge an existing branch into a master branch

Here are the steps:

1. First you want to checkout the master branch to work on it with the command git checkout master












2.  Then you want to pull the existing master branches code from the remote repository with this command git pull origin master






3. Now you are ready to merge the branch with the master branch with this command git merge myBranchName













4. The final step is to push the changes to the remote repository with this command git push origin master







If you go into github and look at the master branch you will see the changes you've made in the new branch






























Previous: git & github: Create A New Branch

No comments:

Post a Comment

Search This Blog