我刚刚在一个已经存在的 git 仓库上运行了 git init。
结果是Reinitialized existing Git repository
我该如何撤销?
谢谢!
最佳答案
不需要 - 这样做很安全。 From the documentation :
Running git init in an existing repository is safe.
It will not overwrite things that are already there.
The primary reason for rerunning git init is to pick up newly added templates.
模板是一些文件,例如作为 git 一部分的示例 Hook 和示例文件。 如果你在创建 repo 后更新了 git 并且这些文件发生了变化,它们将不会更新 - 只会添加新文件。 由于这些文件实际上都不是“事件的”,因此这应该是完全安全的。
关于git - Reinitialized existing Git repository 如何撤销误操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19397888/