我首先想到了撤销add的文件,重新add、commit、push。 git reset HEAD
但是push时又提示 Another git process seems to be running in this repository, e.g. an editor o 的错误。
原因在于git在使用过程中遭遇了奔溃,部分被上锁资源没有被释放导致
解决方案:进入项目文件夹下的 .git文件中(显示隐藏文件夹或rm .git/index.lock)删除index.lock文件即可。
因为许多电脑是不显示.git文件的所以要先执行命令行
mac查看.git文件夹的命令 defaults write com.apple.finder AppleShowAllFiles TRUE