Created
January 25, 2012 18:40
-
-
Save mattfinlayson/1677813 to your computer and use it in GitHub Desktop.
Your branch is ahead of 'origin/master' by 1 commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I noticed that some of my Git repos give me nice status messages like "Your branch is ahead of 'origin/master' by 1 commit" whenever I do a git status while others do not. | |
I think it's because some of them weren't originally clones and had their "remote" configuration set up manually, but not completely in the way that you get when you run git clone with a recent version of Git. Whatever the cause was, here's the fix. | |
Here's a section of the .git/config file for a clone which does display the additional status information: | |
[remote "origin"] | |
url = git://github.com/rentzsch/mogenerator.git | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
[branch "master"] | |
remote = origin | |
merge = refs/heads/master | |
And here's the equivalent config for a repo which doesn't show the status information: | |
[remote "origin"] | |
url = git://github.com/rentzsch/mogenerator.git | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
The fix? Add the required info using git config: | |
$ git config branch.master.remote origin | |
$ git config branch.master.merge refs/heads/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment