当我 git checkout< revision> ,那么这会将整个项目返回到它的状态,还是只重新创建那个特定修订版中更改的文件?
例如:如果我的文件夹除了.git repo和I git checkout master 之外完全是空的,那么生成的文件将是其中的项目整体,还是只有在最近的提交中更改过的文件?
我问,因为我在各个点(从头开始)检查我的项目,该项目的规模正在缓慢增长,正如人们所预料的那样,每个结账的规模都有很大的不同。
$ b当我 git checkout< revision> 时,它是否会将整个项目返回到当时的状态,或者它只是重新创建更改的文件如果您的工作树和 > staging区域是完全空的(当然除了 .git 子目录)并且运行
git checkout< revision>那么您的工作树和临时区域将完美地反映出特定
每次结帐的大小相差很多。
您是否考虑到未跟踪的文件?你提交了,然后删除大文件?根据您在问题中提供的信息,我们可以做的不过是推测尺寸差异很大的原因。
Newb question, I want to make sure I understand this.
When I git checkout <revision>, does this return the entire project to its state at that moment, or does it only recreate the files changed in that particular revision?
For example: If my folder was completely empty besides the .git repo, and I git checkout master, will the resulting files be the project in its entirety, or only the files changed in the most recent commit?
I ask, because I am checking out my project at various points (starting from the beginning), and instead of the project slowly growing in size as one would expect, the size of each checkout is varying quite a lot.
解决方案When I git checkout <revision>, does this return the entire project to its state at that moment, or does it only recreate the files changed in that particular revision?
If your working tree and staging area are completely empty (besides the .git subdirectory, of course) and you run
git checkout <revision>then your working tree and staging area will perfectly reflect the contents of that particular revision.
On the other hand, if your working tree is not empty when you run git checkout, what happens is much more subtle, and may be broken down into three cases:
[...] the size of each checkout is varying quite a lot.
Are you taking into account untracked files? Did you commit, then later remove large files? On the basis of the information given in your question alone, we can do little more than hypothesize about the reason why the size varies a lot.
更多推荐
git checkout是否更新所有文件?
发布评论