开发者

"Git directory" and "working directory"

If I und开发者_如何学Cerstood it correctly, Git directory is the hidden directoy named .git which resides in the working directory. And all the code and history info is stored in the Git directory.

So I expected that when I clone some repo from GitHub, as shown below:

git clone git://github.com/schacon/grit.git .

I should just download the .git directory.

But there're plenty of other files in the working directory besides the hidden .git directory. I didn't expect to download other people's working directory.

Why?

Thanks.


Git automatically prepares the working directory for you by creating the files corresponding to the master branch (or whatever you have configured as the default branch). It is not somebody else's working diretory. Its yours ;)

If you just want the bare .git folder, use --bare or --mirror keys.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜