3

I am having the "fatal: Not a git repository (or any of the parent directories): .git" problem, although I am in a valid git directory.

I have a project root that has .git. I have a sub-directory site which has a separate sbt file for building scaladocs and using the gh-pages plugin to push them to the gh-pages branch of my project.

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

$ ls -la ..
total 359148
...
drwxr-xr-x   8 myname myname     4096 Jun 18 22:41 .git

$ sbt ghpages-push-site
...
[error] fatal: Not a git repository (or any of the parent directories): .git

So what am I missing? I am in a valid git directory (as git status confirms).


I also made a fresh checkout from origin, no luck. I ran git init in the site sub-directory. No luck, that error just persists.


Edit: The odd thing is, I have a different GitHub project with exactly the same layout and sbt build file, and here the problem does not occur. This works, this doesn't. Is it possible that it has to do with the latter project using a different organisation?

Community
  • 1
  • 1
0__
  • 66,707
  • 21
  • 171
  • 266

2 Answers2

5

There is a clone of your repo in

~/.sbt/ghpages/{organisation}/{name} 

which will be created when you run it in the first place. If you create another project with the same organisation and the git clone failed somehow then the directory in

~/.sbt/ghpages/{organisation}/{name} 

is empty and git complains that there is no .git directory later on. if you rename the orga of your project, then you will find a different directory under ~/.sbt/ghpages/ and everything works fine as you found out. When you remove the folder with the organisation name (or the directory with your repo name) everything should also work again.

matlockx
  • 425
  • 5
  • 11
  • Actually, rm -rf ~/.sbt/ghpages/{organisation/username}/{name} And try again. This should do the trick. – matlockx Sep 14 '14 at 14:08
2

Changing the organization key of sbt made it work. Before it was

organization := "at.iem.sysson"

I changed it to

organization := "de.sciss"

Since these are not the git user-names, I don't understand what this has to do with anything. Yet, the site got successfully pushed to iem-projects.github.io/sysson now...

0__
  • 66,707
  • 21
  • 171
  • 266