Where does Git store files?

前端 未结 10 1087
花落未央
花落未央 2020-12-08 09:15

I just ran the following commands on my Ruby on Rails project:

git init
git add .
git commit -a -m \'Initial\'

Where does Git actually stor

相关标签:
10条回答
  • 2020-12-08 09:39

    In a .git directory in the root of the project. Unlike some other version control systems, notably CVS, there are no additional directories in any of the subdirectories.

    0 讨论(0)
  • 2020-12-08 09:40

    I also couldn't find my git repository. I am using Windows 8 and created my repository (by mistake) under C:\Program Files (x86)\Git. I could see the repository folder in bash but not in cmd or Windows Explorer.

    Then I remembered about Windows's "Virtual Store" feature. My repository folder was actually created under C:\Users\<username>\AppData\Local\VirtualStore\Program Files (x86)\Git\<myrepo> and in there was my .git folder!

    0 讨论(0)
  • 2020-12-08 09:46

    If you are looking for where the project folder was created. I noticed when I typed in the git bash.

    $ git init projectName

    it will tell me, where the project folder is for that project.

    0 讨论(0)
  • 2020-12-08 09:47

    I'm on Windows and found my location by right clicking the Git Bash program in my Start menu and selecting Properties. The Shortcut tab shows the "Start in:" value. For me, it was %HOMEDRIVE%%HOMEPATH%, so I opened a CMD prompt and typed echo %HOMEDRIVE%%HOMEPATH% to see the actual location.

    0 讨论(0)
提交回复
热议问题