Skip to content

Instantly share code, notes, and snippets.

@archiewald
Created October 4, 2020 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save archiewald/985488de6da3cd4b587854a3e713c1e8 to your computer and use it in GitHub Desktop.
Save archiewald/985488de6da3cd4b587854a3e713c1e8 to your computer and use it in GitHub Desktop.
#git [git pull --rebase]

More precisely, git pull runs git fetch with the given parameters and calls git merge to merge the retrieved branch heads into the current branch. With --rebase, it runs git rebase instead of git merge.

rebasing

If you pull remote changes with the flag --rebase, then your local changes are reapplied on top of the remote changes.

git pull --rebase

merging

If you pull remote changes with the flag --merge, which is also the default, then your local changes are merged with the remote changes. This results in a merge commit that points to the latest local commit and the latest remote commit.

git pull --merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment