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
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.
Silly solution from me, but I thought that it wasn't adding and pushing new files because github.com wasn't showing the files I had just pushed. I had forgotten that the files I added were on a different branch. The files had push just fine. I had to switch from my master branch to the new branch in github to see them. Lost a few minutes on that one :)
I recently experienced this issue on my computer running Windows 7. I am using the git command window interface. The solution was to be very careful about the case sensitivity of the file and directory names when doing the git add. Although git would not complain when the case did not exactly match the case of the Windows file system file and directory names it also would not add the files. There would be nothing to commit. Once I typed the file names with the exactly correct case they would be added and listed under the changes to be committed as I intended.
Odd, but I fought with git all night to add a file. Turns out it was already added. Git wasn't picking up my changes, as the changes weren't being saved, as the file was inaccessible by my account, and my IDE wasn't reporting this over SSH.
In short, check to make sure you don't have it already added to the repository.
How about the standard procedure:
git add folder
git commit
This will add the folder and all it's files with a single command.
Please note, git is not able to store empty folders.
If commit didn't worked, the first place you should check is probably .gitignore
.
Here you can find an answer to the same problem:
basically in this case the problem was the global_git ignore