This command works to get the files and compile them:
git clone a-valid-git-url
for example:
git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts
However, git status
(or any other git command) then gives the above fatal: Not a git repository (or any of the parent directories)
error.
What am I doing wrong?
I had another problem. I was in a git directory, but got there through a symlink. I had to go into the directory directly (i.e. not through the symlink) then it worked fine.
I just got this message and there is a very simple answer before trying the others. At the parent directory, type
git init
This will initialize the directory for git. Then
git add
andgit commit
should work.In my case, the original repository was a bare one.
So, I had to type (in windows):
To check if a repository is a bare one:
In my case, was an environment variable
GIT_DIR
, which I added to access faster.This also broke all my local repos in SourceTree :(
Simply, after you clone the repo you need to cd (change your current directory) to the new cloned folder
You have to actually cd into the directory first: