Last Updated: February 25, 2016
· bendihossan

"Merge remote-tracking branch..." What is this? I don't even.

This happens when git pull run before creating a commit and pushing it. The pull does a fetch + merge of the latest code from origin and merges yours in.

Avoiding this can help make the log clearer and easier to review, do this by:

# download the latest commits
git remote update -p

# update the local branch
git merge --ff-only @{u}

# if the above fails with a complaint that the 
# local branch has diverged:
git rebase -p @{u}

Beware: git rebase might not do what you expect it to do, so review the results before pushing. For example:

git log --graph --oneline --decorate --date-order --color --boundary @{u}..

Source and further explanation on the problem and these commands:

1 Response
Add your response

This way is better than git pull --rebase, thanks for sharing.

over 1 year ago ·