我對 git 很陌生,現在使用 git bash 大約 3 天。在學習教程時,我不小心git init寫錯了檔案夾,也就是我計算機中用戶的檔案夾。可悲的是,這意味著我不能只洗掉該檔案夾,因為它會給我帶來問題。
上網查找,發現git rm -r --cached FolderName
哪個不起作用,導致:“ fatal pathspec 'FolderName' did not match any files ”
總而言之,我希望將存盤庫從這個隨機的重要檔案夾更改為檔案夾路徑下更遠的檔案夾,而不洗掉存盤庫當前所在的當前檔案夾。
uj5u.com熱心網友回復:
Git 將其存盤庫資料存盤在一個隱藏.git檔案夾中。因此,如果您通過簡單的方式洗掉所述目錄,rm -rf .git您將從當前目錄中洗掉存盤庫。或者,您可以.git使用mv .git <your desired location here>. 兩者都不會損害您現有的檔案夾結構。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/483497.html
上一篇:Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and tr
