Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Git reporting "Not a git repository"
Git reporting "Not a git repository" [message #10999] Sun, 26 July 2009 05:19 Go to next message
John Bito is currently offline John BitoFriend
Messages: 54
Registered: July 2009
Member
After I tried using eGit to fetch from GitHub to my WinVista laptop, the
Cygwin git status & fsck commands report:

fatal: Not a git repository (or any of the parent directories): .git

The contents of the .git directory look generally OK:

COMMIT_EDITMSG HEAD branches index objects remotes
FETCH_HEAD ORIG_HEAD config logs refs

is there another diagnostic or repair I can try?

Unfortunately, I have some code on my laptop, so I'm reluctant to blow
the repo away and start over.

Thanks for any guidance!
John
Re: Git reporting "Not a git repository" [message #356632 is a reply to message #10999] Tue, 28 July 2009 12:04 Go to previous messageGo to next message
Dmitry Smirnov is currently offline Dmitry SmirnovFriend
Messages: 92
Registered: July 2009
Member
Well, nobody yet answered, let me try..

I had been encountering similar problems when started to use Git (couple
months ago). I did not remember what was the cause of this problem. I
suppose that was because everething was new...

I remember I had installed newer version of Git using Cygwin setup (just
as a possible solution. Once again, I don't remember whether this helped
or not).

What is the version you use?

Dmitry
Re: Git reporting "Not a git repository" [message #369121 is a reply to message #10999] Tue, 28 July 2009 17:36 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1212
Registered: July 2009
Senior Member
John wrote:
> After I tried using eGit to fetch from GitHub to my WinVista laptop, the
> Cygwin git status & fsck commands report:
> fatal: Not a git repository (or any of the parent directories): .git
> The contents of the .git directory look generally OK:
> COMMIT_EDITMSG HEAD branches index objects remotes
> FETCH_HEAD ORIG_HEAD config logs refs
> is there another diagnostic or repair I can try?

Which version of EGit and git on cygwin did you use ?
From which path did you run git status ?
Did you try using msysgit instead of cygwin ?

Matthias
Re: Git reporting "Not a git repository" [message #463660 is a reply to message #369121] Sun, 02 August 2009 17:29 Go to previous messageGo to next message
John Bito is currently offline John BitoFriend
Messages: 54
Registered: July 2009
Member
Matthias Sohn wrote:
> John wrote:

>
> Which version of EGit and git on cygwin did you use ?
The repository that no longer works was last updated by the 'release'
build of Egit at 0.4.9. I'd previously updated it with a a variety of
'integration build' versions. The Cygwin git command reports 1.6.1.2; I
may have also tried 1.6.1.1 as I'm not sure when I updated the Cygwin
install.
> From which path did you run git status ?
The current working directory when I tried the Cygwin git status command
was the top-level of the working copy (containing the .git directory
that I listed in my earlier post.
> Did you try using msysgit instead of cygwin ?
I haven't tried msysgit.
>
> Matthias
Thanks, Matthias! The repository turned out to be unusable by Egit as
well (see below). I ended up cloning a fresh one and copying my changes
over. Good thing I push to a git-managed repository and don't rely too
heavily on Egit!

If I open the workspace containing the corrupted repository Egit
generates a series of errors:

eclipse.buildId=I20090611-1540
java.version=1.6.0_13
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86

This is a continuation of log file C:\Users\IBM
User\ADS35Workspace\.metadata\.bak_0.log
Created Time: 2009-08-02 10:22:47.443


Error
Sun Aug 02 10:23:01 PDT 2009
Exceeded maximum ref depth of 5 at HEAD. Circular reference?

java.io.IOException: Exceeded maximum ref depth of 5 at HEAD. Circular
reference?
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:332)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:273)
at org.spearce.jgit.lib.RefDatabase.readRef(RefDatabase.java:17 3)
at org.spearce.jgit.lib.Repository.resolveSimple(Repository.jav a:704)
at org.spearce.jgit.lib.Repository.resolve(Repository.java:697)
at
org.spearce.egit.ui.internal.decorators.DecoratableResourceA dapter. <init>(DecoratableResourceAdapter.java:87)
at
org.spearce.egit.ui.internal.decorators.GitLightweightDecora tor.decorate(GitLightweightDecorator.java:173)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorDefin ition.decorate(LightweightDecoratorDefinition.java:263)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorManag er$LightweightRunnable.run(LightweightDecoratorManager.java: 81)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorManag er.decorate(LightweightDecoratorManager.java:365)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorManag er.getDecorations(LightweightDecoratorManager.java:347)
at
org.eclipse.ui.internal.decorators.DecorationScheduler$1.ens ureResultCached(DecorationScheduler.java:371)
at
org.eclipse.ui.internal.decorators.DecorationScheduler$1.run (DecorationScheduler.java:331)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Re: Git reporting "Not a git repository" [message #467874 is a reply to message #463660] Mon, 03 August 2009 09:09 Go to previous messageGo to next message
Dmitry Smirnov is currently offline Dmitry SmirnovFriend
Messages: 92
Registered: July 2009
Member
> Matthias Sohn wrote:
> The repository that no longer works was last updated by the 'release'
> build of Egit at 0.4.9. I'd previously updated it with a a variety of
> 'integration build' versions.

Yeah, I also upgraded to this version on some stage. Perhaps, this is the
root cause.
Currently, the only incompatibility between Egit and Cygwin Git is the
executable bit of files, that Egit sets (not on purpose) when checking
out.
Cygwin Git reports as a lot of files chnaged in the source tree.
Re: Git reporting "Not a git repository" [message #467988 is a reply to message #463660] Mon, 03 August 2009 14:14 Go to previous messageGo to next message
Shawn O. Pearce is currently offline Shawn O. PearceFriend
Messages: 82
Registered: July 2009
Member
John wrote:
> Thanks, Matthias! The repository turned out to be unusable by Egit as
> well (see below)
....
> Exceeded maximum ref depth of 5 at HEAD. Circular reference?
>
> java.io.IOException: Exceeded maximum ref depth of 5 at HEAD. Circular
> reference?
> at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:332)

*sigh*

Apparently the HEAD reference was in a cycle, which is why C Git also
didn't want to touch this repository. Not sure how that happened on
clone within EGit, but it did, and its a bug in EGit's CloneOp.

Usually an easy way to fix this is:

echo 'ref: refs/heads/master' >.git/HEAD

though you shouldn't ever have to do that.
Re: Git reporting "Not a git repository" [message #468017 is a reply to message #467988] Mon, 03 August 2009 15:40 Go to previous message
John Bito is currently offline John BitoFriend
Messages: 54
Registered: July 2009
Member
Sorry that I can't reconstruct steps that produce this situation. As
Shawn suspects, the HEAD is incorrect (and contains HEAD). I'm fairly
certain this was caused by my attempt to use the "Fetch From" command.
Perhaps it's worth noting that when I clone (and fetch), I'm specifying
a branch other than 'master'. I've noticed that my local repo sometimes
loses the tracking branch for master, so it's likely that it was in
that state at the time that I tried to fetch. To be clear, I've not
experienced any problem immediately after a straight clone.

Please let me know if you'd like to have a defect recorded given that I
don't have any more information than what I've stated above.

Thanks!
John

Shawn Pearce wrote:
> John wrote:
>> Thanks, Matthias! The repository turned out to be unusable by Egit as
>> well (see below)
> ...
>> Exceeded maximum ref depth of 5 at HEAD. Circular reference?
>>
>> java.io.IOException: Exceeded maximum ref depth of 5 at HEAD.
>> Circular reference?
>> at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:332)
>
> *sigh*
>
> Apparently the HEAD reference was in a cycle, which is why C Git also
> didn't want to touch this repository. Not sure how that happened on
> clone within EGit, but it did, and its a bug in EGit's CloneOp.
>
> Usually an easy way to fix this is:
>
> echo 'ref: refs/heads/master' >.git/HEAD
>
> though you shouldn't ever have to do that.
Re: Git reporting "Not a git repository" [message #573731 is a reply to message #10999] Tue, 28 July 2009 12:04 Go to previous message
Dmitry Smirnov is currently offline Dmitry SmirnovFriend
Messages: 92
Registered: July 2009
Member
Well, nobody yet answered, let me try..

I had been encountering similar problems when started to use Git (couple
months ago). I did not remember what was the cause of this problem. I
suppose that was because everething was new...

I remember I had installed newer version of Git using Cygwin setup (just
as a possible solution. Once again, I don't remember whether this helped
or not).

What is the version you use?

Dmitry
Re: Git reporting "Not a git repository" [message #573746 is a reply to message #10999] Tue, 28 July 2009 17:36 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1212
Registered: July 2009
Senior Member
John wrote:
> After I tried using eGit to fetch from GitHub to my WinVista laptop, the
> Cygwin git status & fsck commands report:
> fatal: Not a git repository (or any of the parent directories): .git
> The contents of the .git directory look generally OK:
> COMMIT_EDITMSG HEAD branches index objects remotes
> FETCH_HEAD ORIG_HEAD config logs refs
> is there another diagnostic or repair I can try?

Which version of EGit and git on cygwin did you use ?
From which path did you run git status ?
Did you try using msysgit instead of cygwin ?

Matthias
Re: Git reporting "Not a git repository" [message #573766 is a reply to message #369121] Sun, 02 August 2009 17:29 Go to previous message
John Bito is currently offline John BitoFriend
Messages: 54
Registered: July 2009
Member
Matthias Sohn wrote:
> John wrote:

>
> Which version of EGit and git on cygwin did you use ?
The repository that no longer works was last updated by the 'release'
build of Egit at 0.4.9. I'd previously updated it with a a variety of
'integration build' versions. The Cygwin git command reports 1.6.1.2; I
may have also tried 1.6.1.1 as I'm not sure when I updated the Cygwin
install.
> From which path did you run git status ?
The current working directory when I tried the Cygwin git status command
was the top-level of the working copy (containing the .git directory
that I listed in my earlier post.
> Did you try using msysgit instead of cygwin ?
I haven't tried msysgit.
>
> Matthias
Thanks, Matthias! The repository turned out to be unusable by Egit as
well (see below). I ended up cloning a fresh one and copying my changes
over. Good thing I push to a git-managed repository and don't rely too
heavily on Egit!

If I open the workspace containing the corrupted repository Egit
generates a series of errors:

eclipse.buildId=I20090611-1540
java.version=1.6.0_13
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86

This is a continuation of log file C:\Users\IBM
User\ADS35Workspace\.metadata\.bak_0.log
Created Time: 2009-08-02 10:22:47.443


Error
Sun Aug 02 10:23:01 PDT 2009
Exceeded maximum ref depth of 5 at HEAD. Circular reference?

java.io.IOException: Exceeded maximum ref depth of 5 at HEAD. Circular
reference?
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:332)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:337)
at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:273)
at org.spearce.jgit.lib.RefDatabase.readRef(RefDatabase.java:17 3)
at org.spearce.jgit.lib.Repository.resolveSimple(Repository.jav a:704)
at org.spearce.jgit.lib.Repository.resolve(Repository.java:697)
at
org.spearce.egit.ui.internal.decorators.DecoratableResourceA dapter. <init>(DecoratableResourceAdapter.java:87)
at
org.spearce.egit.ui.internal.decorators.GitLightweightDecora tor.decorate(GitLightweightDecorator.java:173)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorDefin ition.decorate(LightweightDecoratorDefinition.java:263)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorManag er$LightweightRunnable.run(LightweightDecoratorManager.java: 81)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorManag er.decorate(LightweightDecoratorManager.java:365)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorManag er.getDecorations(LightweightDecoratorManager.java:347)
at
org.eclipse.ui.internal.decorators.DecorationScheduler$1.ens ureResultCached(DecorationScheduler.java:371)
at
org.eclipse.ui.internal.decorators.DecorationScheduler$1.run (DecorationScheduler.java:331)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Re: Git reporting "Not a git repository" [message #573781 is a reply to message #463660] Mon, 03 August 2009 09:09 Go to previous message
Dmitry Smirnov is currently offline Dmitry SmirnovFriend
Messages: 92
Registered: July 2009
Member
> Matthias Sohn wrote:
> The repository that no longer works was last updated by the 'release'
> build of Egit at 0.4.9. I'd previously updated it with a a variety of
> 'integration build' versions.

Yeah, I also upgraded to this version on some stage. Perhaps, this is the
root cause.
Currently, the only incompatibility between Egit and Cygwin Git is the
executable bit of files, that Egit sets (not on purpose) when checking
out.
Cygwin Git reports as a lot of files chnaged in the source tree.
Re: Git reporting "Not a git repository" [message #573794 is a reply to message #463660] Mon, 03 August 2009 14:14 Go to previous message
Shawn O. Pearce is currently offline Shawn O. PearceFriend
Messages: 82
Registered: July 2009
Member
John wrote:
> Thanks, Matthias! The repository turned out to be unusable by Egit as
> well (see below)
....
> Exceeded maximum ref depth of 5 at HEAD. Circular reference?
>
> java.io.IOException: Exceeded maximum ref depth of 5 at HEAD. Circular
> reference?
> at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:332)

*sigh*

Apparently the HEAD reference was in a cycle, which is why C Git also
didn't want to touch this repository. Not sure how that happened on
clone within EGit, but it did, and its a bug in EGit's CloneOp.

Usually an easy way to fix this is:

echo 'ref: refs/heads/master' >.git/HEAD

though you shouldn't ever have to do that.
Re: Git reporting "Not a git repository" [message #573807 is a reply to message #467988] Mon, 03 August 2009 15:40 Go to previous message
John Bito is currently offline John BitoFriend
Messages: 54
Registered: July 2009
Member
Sorry that I can't reconstruct steps that produce this situation. As
Shawn suspects, the HEAD is incorrect (and contains HEAD). I'm fairly
certain this was caused by my attempt to use the "Fetch From" command.
Perhaps it's worth noting that when I clone (and fetch), I'm specifying
a branch other than 'master'. I've noticed that my local repo sometimes
loses the tracking branch for master, so it's likely that it was in
that state at the time that I tried to fetch. To be clear, I've not
experienced any problem immediately after a straight clone.

Please let me know if you'd like to have a defect recorded given that I
don't have any more information than what I've stated above.

Thanks!
John

Shawn Pearce wrote:
> John wrote:
>> Thanks, Matthias! The repository turned out to be unusable by Egit as
>> well (see below)
> ...
>> Exceeded maximum ref depth of 5 at HEAD. Circular reference?
>>
>> java.io.IOException: Exceeded maximum ref depth of 5 at HEAD.
>> Circular reference?
>> at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.ja va:332)
>
> *sigh*
>
> Apparently the HEAD reference was in a cycle, which is why C Git also
> didn't want to touch this repository. Not sure how that happened on
> clone within EGit, but it did, and its a bug in EGit's CloneOp.
>
> Usually an easy way to fix this is:
>
> echo 'ref: refs/heads/master' >.git/HEAD
>
> though you shouldn't ever have to do that.
Previous Topic:Git reporting "Not a git repository"
Next Topic:How create Git repository from Eclipse project?
Goto Forum:
  


Current Time: Tue Aug 16 07:41:56 GMT 2022

Powered by FUDForum. Page generated in 0.02782 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top