2

Git 提交时莫名其妙删除文件

 2 years ago
source link: https://www.v2ex.com/t/824200
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  git

Git 提交时莫名其妙删除文件

  ddllzz · 7 小时 43 分钟前 · 1294 次点击

使用 Git 提交文件的时候,显示新建、删除了很多文件(这些文件这一次根本没有改动到,git status 也没有显示这些文件),我实际只提交了那个圈起来的文件。

各位有谁遇到过这种情况吗,需要怎么解决呢?

image.png

第 1 条附言  ·  5 小时 54 分钟前

仍然不知道是什么问题,也不知道是什么原因导致的,上次也出现过:提交历史记录我删了一个文件,push 之后才发现。然后将这个文件加一行空行,再次 commit ,然后...显示另一个文件被删了。

目前通过以下的方式解决:
1 、在另一个目录下 clone 代码
2 、删除原项目中的 .git 目录
3 、复制刚克隆的 .git 目录过去

感谢大家的回复。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK