Skip to content

Instantly share code, notes, and snippets.

@thomascrenshaw
Created January 31, 2014 18:52
Show Gist options
  • Select an option

  • Save thomascrenshaw/8740531 to your computer and use it in GitHub Desktop.

Select an option

Save thomascrenshaw/8740531 to your computer and use it in GitHub Desktop.

Revisions

  1. thomascrenshaw created this gist Jan 31, 2014.
    12 changes: 12 additions & 0 deletions My Memory - Git Commands
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ##---------------------------
    ## Keep local branch up-to-date with remote
    # Add the upstream remote if have not already done so
    git remote add upstream REMOTE_PROJECT_URL_git
    # Fetch changes in REMOTE_PROJECT_URL_git
    git fetch upstream
    # Bring master of your locl fork-clone up-to-date
    git checkout master && git merge upstream/master
    # Rebase the LOCAL_BRANCH works if no uncommited changes
    git rebase upstream/master
    # -OR- to update branch on local fork
    git checkout LOCAL_BRANCH && git merge upstream/master