的Git命令:爲什麼github在創建新的存儲庫時顯示灰色文件夾?
git init
git add .
git commit -m "project"
git remote add origin https://github.com/
git push -u origin master
如何解決這個問題?
的Git命令:爲什麼github在創建新的存儲庫時顯示灰色文件夾?
git init
git add .
git commit -m "project"
git remote add origin https://github.com/
git push -u origin master
如何解決這個問題?
因爲您的回購包括嵌套的git回購(其中包含.git/
文件夾的子文件夾)。
當你做一個git add .
,你將記錄該子文件夾作爲gitlink(special entry in the index),一旦推到你的GitHub庫,顯示爲灰色文件夾。
另請參閱「Difference between nested git repos and submodules」。
如果要將文件夾內容包含到源中,只需刪除該灰色目錄的.git
文件夾,再次執行git add .
,提交併推送。
謝謝,工作它, –
@RaminFarajpourCami太棒了!不要忘記閱讀http://stackoverflow.com/help/accepted-answer和http://stackoverflow.com/help/why-vote – VonC
好吧;),再次感謝 –
我不確定。除了顏色本身,這對你有什麼影響? –
[目錄在github上顯示爲灰色文件夾,但未跟蹤其內容的可能重複。爲什麼?](http://stackoverflow.com/questions/35140715/directory-showing-up-as-a-grey-folder-on-github-but-not-tracking-its-content-w) – Chris