Git: Where exactly is the “working directory”?

后端 未结 6 469
抹茶落季
抹茶落季 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:41

    To kind of combine the two other answers:

    As stated in the Git Documentation:

    The working directory is a single checkout of one version of the project.

    This essentially means if you checkout a branch (e.g. master) and are sat on a particular commit (e.g. HEAD), your working directory is the "umbrella" term for all your files and folders.

    It isn't a particular directory/folder though. The working directory covers all directories, files...everything.
    I mention this because when you want to commit some files, those files will be in the working directory and you'll need to stage them (using git add) before committing them (using git commit).

提交回复
热议问题