Update local branch to upstream origin

Update local branch to upstream origin

Situation: The branch you’re working off has fallen behind from the origin, you need to get it up-to-date. This allow you to get your local branch up-to-date with ‘origin’ without having to switch over the develop branch to run git pull, you can do it right in the current branch.

This is the command to run in terminal. Make sure you’re in the appropriate project directory.

# ensure we are working off the latest version of the upstream repo
git pull origin

# bring the latest changes into our local branch
git merge develop

# resolve conflicts...

# push the latest version of the local branch...

See this stack overflow for a command to see ahead/behind for all branches.

For more content on data science, R, and Python find me on Twitter.

Previous
Next