Tag Archives: Your branch is ahead of XXX

Git Status Warming: Your branch is ahead of ‘origin/master’ by 1 commit…

When running git status, git will compare the local branch dev with the remote branch it is tracking ( origin/Master ), because origin/Master has not been changed, it is still the 1 commit/change after the current dev branch (and origin/dev ), so a prompt will appear.

What we want to do is change the local dev branch to track the remote dev branch.

Solution (one of two options)

① , operation

git branch --set-upstream-to=origin/dev

② Add -- set upstream to the push command when pushing:

git push origin dev --set-upstream