Does git checkout update all files?

后端 未结 2 658
北荒
北荒 2021-01-18 06:44

Newb question, I want to make sure I understand this.

When I git checkout , does this return the entire project to its state at

2条回答
  •  Happy的楠姐
    2021-01-18 06:48

    From the documentation: "Updates files in the working tree to match the version in the index or the specified tree. " In the case of your example, it will return the repository to the state at the time of the checkout in its entirety.

    However as Jubobs pointed out there is a difference in behaviour if you have made any changes to the state of your repository since your last checkout. His answer is more comprehensive than mine if this is the case.

    Also note that this will only apply to files that are tracked by git, so any other files you have lying around will not be affected.

提交回复
热议问题