Won't add files?
I'm having issues where I can't add files to my repository.
I'm using GIT on windows, in Aptana Studio for some Ruby development.
I've managed to push a few files up to GitHub, but then after this, everything's stopped working. I have for example a new sub-folder in my master directory, with 2 ruby files inside. If I call "git add .", and then "git status" and it keeps saying "working directory clean" and has nothing to commit.
I've tried "git add folder/myfile.rb" and still nothing.
Anyone any idea's what I can try?
I found myself in a similar situation as the poster:
If I call "git add .", and then "git status" and it keeps saying "working directory clean" and has nothing to commit.
But I had a different solution than what's here. Since I came to this first, I hope to save others some time.
From the above answers and what I've seen elsewhere, the usual fixes to this problem are:
.gitignore
and .git/info/exclude
.gitkeep
as a placeholder so git will track the folder. In my case, I had originally tried to create a git repo around an existing repo (not knowing it was there). I had removed the .git
folder from this sub repo a while ago, but I didn't realize that it was too late, and git was already tracking it as a submodule . You can read more about how these behave and how to remove them here, but
git rm --cached path_to_submodule
. Double check your .gitignore
file to make sure that the file is able to be seen by Git. Likewise, there is a file .git/info/exclude
that 'excludes' files/directories from the project, just like a .gitignore
file would.
如果该文件被.gitignore
排除,并且您想要添加该文件,则可以使用以下命令强制执行:
git add -f path/to/file.ext
链接地址: http://www.djcxy.com/p/16454.html
上一篇: 目前删除git子模块的方式是什么?
下一篇: 不会添加文件?