简体   繁体   中英

“Git directory” and “working directory”

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM