2

I'm cloning a Git repository by copying the ".git" directory. If I run "git checkout" in that directory it gets me the contents of HEAD. How do I get the staged changes from the original repository? Are they not stored in ".git" and if so is the only way to copy the source files then?

4

1 回答 1

3

如果您运行git status,您应该会看到分阶段的更改仍在索引中。如果可行,请继续运行:

git checkout -- .

那应该重置当前的工作目录以匹配您上演的内容。

有关更多信息,请参阅“如何在 Git 中丢弃未暂存的更改? ”。

于 2013-07-30T20:04:35.070 回答