[英]Unstage file in a git repo where there are no commits
有没有办法在没有提交的情况下撤消git存储库中的文件?
如果您尝试执行git add .
在没有提交的新创建的git repo上,然后尝试执行git reset
您将从git获得以下内容:
无法将“ HEAD”解析为有效的参考。
有替代方法吗?
愚蠢的是,它在git status
输出中正确:
git rm --cached -r .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.