Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lamdor/6985 to your computer and use it in GitHub Desktop.
Save lamdor/6985 to your computer and use it in GitHub Desktop.
To create a local branch that follows a remote branch (two ways):
First way (creates the branch that follows the remote branch "origin/master" and switches to it):
git checkout -b pull-watch origin/master
Second way (just creates the branch):
git branch pull-watch origin/master
Then after switching to the pull watch branch:
git pull
Another way to pull in changes without changing your local branches is just do a "git fetch". This will grab all of the changes in the remote repository, but not merge any into your local branches. Once you've looked over the changes using a "git log origin/master", you can then just do a "git merge origin/master" to apply the changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment