问题描述
我是Git的新手。
我可以使用 git -init --bare
在裸目录中获得Git目录结构。
我可以看到git信息的存储位置。
然而,当我尝试使用 git init
甚至是 git clone
,我从未在我的本地存储库中看到任何 .git
子目录。我可以添加文件和推送,但不知道这些文件实际存储在本地存储库的磁盘中的位置。
从文档:
但是,我从来没有看到骨架目录。我用 dir -AH
来查看git目录是否隐藏,但是没有。为什么我没有得到一个git骨架目录?那么,究竟是添加(staged)的文件吗?
除非您使用当运行git init时,你的
选项。也许你应该仔细看看。 .git
目录 MUST 必须位于目录中--git-dir
在同样的想法中,也许你已经设置了一个环境变量 GIT_DIR
存放 .git
目录的地方。请参阅删除此内容如果是这种情况,env变量。
添加的(分阶段)文件存储在文件中的
目录... 索引
.git
dir -AH
(在powershell中,否则它是 dir / AH
)适合我...
I am new to Git.I can get a Git directory structure in a bare directory with git -init --bare
.I can see where the git information is stored.
However, when I try to use git init
or even git clone
, I never see any .git
subdirectory in my local repository. I can add files and push, but have no idea where those files are actually stored on disk for my local repository.
From the documentation:
However, I never see that skeleton directory. I have used dir -AH
to see if the git directory is hidden, but there is none. Why do I not get a git skeleton directory? And where, exactly are the added (staged) files put?
Except if you have used the --git-dir
option when running "git init", your .git
directory MUST be in the directory. Perhaps you should look more carefully.
In the same idea, perhaps have you set an environment variable GIT_DIR
that change the place where the .git
directory is stored. See http://git-scm.com/docs/git-init Remove this env variable if it's the case.
And the added (staged) files are stored in the index
file stored inside this .git
directory...
dir -AH
(in powershell? otherwise it's dir /AH
) works well for me...
这篇关于git init不会为我创建git目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!