2016-02-11 41 views
2

的Git命令:爲什麼github在創建新的存儲庫時顯示灰色文件夾?

git init 
git add . 
git commit -m "project" 
git remote add origin https://github.com/ 
git push -u origin master 

Gray Folder github

如何解決這個問題?

+0

我不確定。除了顏色本身,這對你有什麼影響? –

+0

[目錄在github上顯示爲灰色文件夾,但未跟蹤其內容的可能重複。爲什麼?](http://stackoverflow.com/questions/35140715/directory-showing-up-as-a-grey-folder-on-github-but-not-tracking-its-content-w) – Chris

回答

1

因爲您的回購包括嵌套的git回購(其中包含.git/文件夾的子文件夾)。

當你做一個git add .,你將記錄該子文件夾作爲gitlinkspecial entry in the index),一旦推到你的GitHub庫,顯示爲灰色文件夾。

另請參閱「Difference between nested git repos and submodules」。

如果要將文件夾內容包含到源中,只需刪除該灰色目錄的.git文件夾,再次執行git add .,提交併推送。

+0

謝謝,工作它, –

+0

@RaminFarajpourCami太棒了!不要忘記閱讀http://stackoverflow.com/help/accepted-answer和http://stackoverflow.com/help/why-vote – VonC

+0

好吧;),再次感謝 –

相關問題