git init doesn't create .git directory

Viewed 10164

I'm new to Git, when I run git init in the terminal there's no .git directory created, however i get this result Reinitialized existing Git repository in /Users/Desktop/Javascript/sotrustme/.git/

please help me

7 Answers

You can also verify that the directory is there on your command line by running this command: ls .git

You should then see the hidden folders listed in your terminal

Just click on Hidden Files in view section in file explorer:1]

.git is a hidden directory. You wouldn't expect it to be in public view. In Linux, you will have to use ls -a to view the hidden directory.

You also have:

Reinitialized existing Git repository

What does that mean? That means that the repository is already created so when you run that it becomes initialized again so the old files from Git should be deleted by the time you do this.

I was running into the same issue where I was getting the following error:

error

But then I noticed I had some security notifications on my windows system.

Windows Security notification

After allowing this action from here I was able to use the "git init" along with other commands as well.

Related