使用git上傳代碼出錯總結:

使用git上傳代碼時 出現錯誤:

error: The following untracked working tree files would be overwritten by merge:
gifts/.DS_Store
Please move or remove them before you can merge.
Aborting

使用 git clean -d -fx? 即可解決
執行后:

Removing .DS_Store
Removing gifts/.DS_Store
Removing gifts/gifts/.DS_Store
Removing gifts/gifts/Navigation/.DS_Store
Removing gifts/gifts/Navigation/DateSource/.DS_Store
Removing gifts/gifts/Navigation/Pictures/.DS_Store

將目錄下的.DS_Store文件全部刪除;
不過使用?git clean -d -fx時需要注意 會刪除掉沒有add到倉庫的文檔 大家要謹慎操作!!!

執行 git add .時出現錯誤:

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

解決方案:
rm -f ./.git/index.lock

git 版本回退:

git reflog
git reset --hard
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容