Search code examples
gitgit-init

Git Clone Repo Has No .git File


I cloned a repo with git clone <path to repo> but when I run git status I get the fatal: not a git repository error.

What I want to know is, if I run git init in the local directory that was cloned, will it screw anything up or cause issues with the initial repo on GitHub?

I cd && ls -a into a few directories but I don't see the .git file.

So I first did a search with $ git ls-files | grep .git and got the same fatal no repo error.

Then I did a search with $ find . | grep .git and it listed 3 .gitignore files. Which I assume means the initial creator didn't initialize git.

I want to create a branch and begin working and making commits without messing up the original repo.

I've referenced these following StackOverflow questions but they don't give me the answer I need:

"fatal: Not a git repository (or any of the parent directories)" from git status

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


Solution

  • Your repository seems to be broken. Make sure that you didn't erased by error the .git folder after cloning. Maybe, just clone again and work from that new clone.