Also you might get something like
fatal: Pathspec ‘some.file.name.goes.here’ is in submodule ‘some/folder/name’
Also you might notice, if you commit and pushed, only some skeleton of the of the folder structure without the actual files would be committed.
The root of the problem is the folder you are trying to add is tracked under git itself.
This would confuse git and would rather leave it up to you.
First go ahead and remove the .git folder in the new directory
sudo rm -rf /path/to/new/folder/.git
Then clear the cache from git memory of the new folder
git rm -r --cache /path/to/new/folder
Then when you do the
you will see all the new files being listed and you can commit that.
Was trying to pull something to github and noticed I was using a bit old Git version.
Then I went to and downloaded for mac.
After installing, I checked if I have the latest version by doing
and it showed
git version 126.96.36.199
Then I suspected the previous one is not updated and checked which git binary is being used
And it replied as
The new one is being save on another directory – /usr/local/git
Then I checked how my path is setup
it was something like
As you can see the poor mac would see the /usr/bin first to check if command binary is inside it and it would continue.. so it was not checking the /usr/local/git..
Just putting the proper path infront of the path would solve the problem
That would fix the problem. In the mean time, doing some cleanup on the existing git files would help also..