I have a git repo I've been using for the last year on the same box. Today I run git status
and get the error message:
fatal: Not a git repository (or any parent up to mount parent /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
I have a .git directory and it's populated with the thousands of commits I have for that repo. I don't want to re-initialize the repo in fear that it'll overwrite the history. I also don't really want to re-pull it from github as I've got a few changes stashed in branches that I haven't pushed up to GH in a while.
edit:
I'm reasonably sure it's not my environment. Other git repos are working just fine
I would like to post some comments from the appropriate source file of git:
Git repo discovery is done as per below:
/*
* Test in the following order (relative to the cwd):
* - .git (file containing "gitdir: <path>")
* - .git/
* - ./ (bare)
* - ../.git
* - ../.git/
* - ../ (bare)
* - ../../.git/
* etc.
*/
And it ascertains that it is a git repo as below:
/*
* Test if it looks like we're at a git directory.
* We want to see:
*
* - either an objects/ directory _or_ the proper
* GIT_OBJECT_DIRECTORY environment variable
* - a refs/ directory
* - either a HEAD symlink or a HEAD file that is formatted as
* a proper "ref:", or a regular file HEAD that has a properly
* formatted sha1 object name.
*/
See what's wrong with your .git
. This ties in with @Chris Nicola 's answer of the HEAD
being lowercase etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With