Search code examples
gitrebasefeature-branch

What happens when I 'git pull --rebase origin development' from within a feature branch?


Let's say I have a feature branch called FeatureA, and it is out of sync with (remote) development on which it is based. Normally I would rebase my branch by calling git rebase development (after syncing my local development with origin/development naturally).

Today, I do it different and call git pull --rebase origin development from my feature-branch instead. Now, what is the difference?


Solution

  • git pull --rebase origin development is a shortcut to these commands:

    git fetch origin development
    git rebase origin/development
    

    That is, fetch origin/development and then rebase the current branch on top of it.

    UPDATE

    As @torek pointed out:

    Yes, except that the two-argument version of fetch does not update origin/development in git 1.8.3 or earlier. (The rebase result is the same, but origin/development does not move.)