Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git init doesn't create .git directory

Tags:

git

github

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

like image 975
Azoulay Jason Avatar asked Aug 04 '17 16:08

Azoulay Jason


3 Answers

As others already mentioned, the .git directory is hidden from normal view, by virtue of being named .git. Files and directories with names starting with . are normally not displayed, to keep things uncluttered.

There's one other important point:

... I get this result Reinitialized existing Git repository in ...

(the boldface is of course mine here). This means you already have a Git repository. Your git init is not wiping it out, it's just checking that it looks like a valid Git repository, and making sure any template-specific hooks are set up. (This last part does not affect you: it would only matter if you ran git init --template=<some alternate template directory>.)

like image 137
torek Avatar answered Nov 10 '22 10:11

torek


It should be a hidden folder.

Try to display the hidden folders and you should be able to see it.

Use ls -al to view all the hidden files and folders and their properties.

like image 22
Pritam Banerjee Avatar answered Nov 10 '22 09:11

Pritam Banerjee


git init Will create a .git folder (which is .) means a hidden folder.

The error Reinitialized existing Git repository in /Users/Desktop/Javascript/sotrustme/.git/

This means .git already exist in your Present Working Directory. You can view the .git folder (and all hidden files and folders) by this command

ls -a

You can run git status to check status, if it works git is initialized and working.

like image 32
Sagar Devkota Avatar answered Nov 10 '22 10:11

Sagar Devkota