The question is: will the commit that I had in my local repo branch go on top of the master or since I had already pushed it I will simply get to the tip of the global master/remote branch?
If by "global" you mean "remote", then yes, your local branch is going to be rebased on top of origin/master
. See below for a longer explanation.
Based on your question, your repository started out looking like this:
o---o--------------o
^ ^
master development
origin/master origin/development
Your local master
branch was in sync with the remote origin/master
branch; also, you had a local development
branch with 1 commit, which you pushed to the remote repository thus creating origin/development
.
Now, assuming your current branch is development
, if you run
git pull --rebase origin master
Git is going to fetch any new objects from the origin
remote and update your remote tracking branch origin/master
:
origin/master
⌄
o---o---o
/
o---o--------------o
^ ^
master development
origin/development
Then, it's going to rebase your current branch (in this case development
) on top of the updated origin/master
branch:
origin/master development
⌄ ⌄
o---o---o--------------o'
/
o---o--------------o
^ ^
master origin/development
Note that your local master
branch is still pointing to the same commit it did before—that's because the second part of git pull
(merge or rebase) always operates on the current branch, in your case development
.
Now, if you were to push your local development
branch after the pull operation is complete, you would update the origin/development
remote tracking branch to point to the rebase commit:
origin/development
origin/master development
⌄ ⌄
o---o---o--------------o'
/
o---o
^
master
Again, your local master
is unchanged until you do:
git checkout master && git merge origin/master
The git pull
command is a complex beast, since it does wildly different things based on which branch you're on when you invoke it and which arguments you pass to it.
Here's what the documentation has to say about the form with three arguments:
Merge into the current branch the remote branch next:
$ git pull origin next
This leaves a copy of next temporarily in FETCH_HEAD
, and updates the remote-tracking branch origin/next
.
I also suggest reading this answer for a more detailed explanation of how git pull
behaves in different scenarios.