Git: Where exactly is the “working directory”?

后端 未结 6 470
抹茶落季
抹茶落季 2021-02-01 04:08

I am going through some Git tutorials. The concept of a \"working directory\" keeps being mentioned, however, none of the tutorials or documents I read points out where

6条回答
  •  孤街浪徒
    2021-02-01 04:49

    This should hopefully clear things up for us:

    What is the difference between a repository created using the git init command and the git init --bare command?

    Repositories created with the git init command are called working directories. In the top level folder of the repository you will find two things:

    A .git subfolder with all the git related revision history of your repo
    A working tree, or checked out copies of your project files.
    

    Repositories created with git init --bare are called bare repos. They are structured a bit differently from working directories. First off, they contain no working or checked out copy of your source files. And second, bare repos store git revision history of your repo in the root folder of your repository instead of in a .git subfolder. Note… bare repositories are customarily given a .git extension.

    Taken from John Saints - What is a bare git repository?

    A bare git clone does not contain a working directory of checked out code, in other words.
    Think of it as just the .git directory (the Git database) without anything else.

提交回复
热议问题