How to update your GIT master branch with the changes made to other branches?

First step you need to do is:
  •  git checkout master
  •  git pull
This will make sure you have the latest code from the github repository for the master branch.
Now, you want to rebase your branch on top of the master branch.
  •  git checkout branch_name
  •  git rebase master
If you want you can do an interactive rebase (git rebase -i master) and squish your commits into a single commit.  You may also have to resolve conflicts with other work that has been done since you branched off of master.

Once you've done the rebase, you can then merge your changes into the master branch:
  •  git checkout master
  •  git merge branch_name
Then you need to push your changes up to the remote branch so anyone can pull them down:
  • git push origin master
That's it you have successfully updated your master with the latest changes in the branch...!!!
 

Comments

Popular posts from this blog

How to SSH to remote server without entering password each time.

How to redirect a URL in NGINX

Ruby on Rails Installation on Windows 7