How to quickly get your feature branch up-to-date with upstream



You are working on a feature branch that was created from the master branch. Meanwhile, one of your teammates completed and merged a new feature into master. To update your feature branch with the latest changes from master, follow these steps:

Stash any changes in your current branch (if necessary) using:

$ git stash

Then you can simply update your local master branch by pulling the latest changes from the remote repository and at the same time merge the updated master branch into your feature branch:

$ git pull upstream master:master

This command assumes that your local master is tracking the remote master branch.

Then, if you've stashed changes, you can pop them back using:

$ git stash pop

This process will bring your feature branch up to date with the latest changes on master very quickly.



Done


Leave a comment


Post


Comments

Be the first one to leave a comment!