问题
If I understood 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.
回答1:
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.
来源:https://stackoverflow.com/questions/7188314/git-directory-and-working-directory