Saturday, August 9, 2014

Git Tips: Refreshing Source Code from the Origin (upstream source)

git-scm: quick tips for your reference

I sourced this one from the blog, Gitready: fetching upstream changes.

This tip comes from Dav Glass, whose work on YUI at GitHub requires him to bring in commits frequently. So, he’s created a helpful alias so he can merge in changes easily.

First off, he’s got a consistent naming scheme for his upstream remote:

git remote add upstream git://

Just throw this in your

and you’re all set:

     pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master"

git pu

will grab all of the latest changes from both remotes, and then merge in the commits from upstream.

Post a Comment