將我的代碼歷史記錄推送到git存儲庫時,我發現Objective-C項目作爲子模塊工作,這意味着如果我推入Objective-C項目,它將作爲子模塊工作,如this。如何刪除git子模塊殘骸?
當我注意到這個因素後,我試着重新初始化我的文件夾.git。 (刪除並試圖調用'git init')
但它根本無法工作,子模塊仍然存在。
我也試過git submodule deinit and init command。但是,之後,即使我試圖將我的文件推送到git存儲庫,它也會拋出此消息。
Sogos-Macbook:Test code dkswogus7530$ git push -u origin master
To https://github.com/JaehyunAhn/cpuls2_book_review.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/JaehyunAhn/cpuls2_book_review.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
我也試圖更新&刪除我的git倉庫鍵入命令的git拉出身主和該命令中止此消息
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 537 bytes | 0 bytes/s, done.
Total 5 (delta 2), reused 0 (delta 0)
remote: error: object d5c202897cf6f769235a2707d15719636fe37984:contains duplicate file entries
remote: fatal: Error in object
error: unpack failed: index-pack abnormal exit
To https://github.com/JaehyunAhn/cpuls2_book_review.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'https://github.com/JaehyunAhn/cpuls2_book_review.git'
我怎樣才能解決這個問題呢?
這submodule repository指出從this,this和this。
混帳RM --cached「子模塊目錄」 – johnMa
我試過了也行,不過它刪除了這條消息:Sogos-Macbook:測試代碼dkswogus7530 $ git rm --cached ACM_craft 致命:不刪除'ACM_craft'遞歸地沒有-r – Sogo