How to merge local branch with master[Git]

In this post, I am going to show the step by step instructions for merging our local branch with the master.

Please follow the below steps,

1. Go into your GitHub repository or your project repository
2. Create a local branch with the below command,

git branch local-branch

3. Then move into that branch

git checkout local-branch

4. Then make the relevant changes and issue the below commands to commit it

  git add .
  git commit -m "commit message"

5. Then move back to master branch and merge it as below

  git checkout master
  git merge local-branch
  git push origin master
   

If you see any conflicts while doing push, then do rebase and then push.

Advertisements