Git doesn't show how many commits are in front of me, and I want it to

There are many questions about Git saying that people are ahead of the remote branch on the X commit, and they want it to stop.

I have the opposite problem. I want Git to tell me how much I have earned, but that is not the case.

When I first created my remote open repository, then cloned it, it worked. In my case, I first created a local repository, then cloned it (bare) to the remote computer.

This will install my local repository as a remote repository console. But I deleted this and manually added the remote repository link to my local one. Pushing works fine. But I do not see the message "You are ahead of X commits." How can i get it?

+52
git
Mar 17 2018-11-17T00:
source share
2 answers

git branch --set-upstream local origin/remote

local and remote are the names of your local or. remote branches.

In Git version 1.8 and later, this is even easier. Make sure you are in the local branch, and then:

git branch --set-upstream-to origin/remote

+70
Mar 17 2018-11-17T00:
source share

I found that there is a way to make this default behavior:

 git config --global branch.autosetupmerge always 

Despite the name, this does not force you to always merge branches; you can still reinstall if you want.

It will guarantee that at any time when you create a new branch, you can automatically see how many commits are different from the branch from which it was created.

+6
Aug 12 '11 at 16:01
source share



All Articles