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
I know this is a really old question, but I know it can happen to someone as well, turns out I was working with a file named AUX.JS and thi is a reserved file name for windows, this produced the following error
fatal: unable to stat 'src/hoc/Aux.js': No such file or directory
so you can either remove the file or rename it, then it will work.
Final conclusion, in addition to all other valid answers, if you are in a windows machine look out for the output of the 'git add' command, it can also provide additional information.
I had a problem where files from one folder wont get added to the Github source control. To solve that I deleted the .git folder that was created under that folder.
It's impossible (for me) to add the first file to an empty repository cloned from GitHub. You need to follow the link README, that GitHub suggests to create. After you create your first file online, you can work normally with git.
This happened to me Nov 17, 2016.
Issue git would not add a changed file. Using git bash, I had changed folder delimiting the folder name with the double quote. ls displayed the folder contents correctly but git would not add changed files.
Solution I used the single quote to delimit the folder name.
e.g. CD "Folder Name" git status nothing to commit, working tree clean CD .. ls 'Folder Name' CD 'Folder Name' git status modified: ModifiedFileName.bat
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
.I had the same problem and it was because there was a program using some file and git throws an error in this case Visual Studio had locked that file.