Is the Git staging area just an index?

后端 未结 5 1965
小鲜肉
小鲜肉 2021-02-07 00:01

The book Pro Git says that the staging area is just a list, or index, that says which files will be committed when a git commit is done, and now the name inde

5条回答
  •  无人及你
    2021-02-07 00:49

    The index is like an out basket of completed work. At any point you can add a (part) completed file to that out basket and it will replace the previous copy with your current copy, so that when you finally decide to commit it will use the contents of that out basket (the current index) to create the commit.

    In addition your earlier add will have create a blob object within the repo that can be found if required via the various logs. After a while (30 days+) it will disappear with gc.

提交回复
热议问题