I started getting this message. No matter what I edit and try to commit, it says there is nothing to commit. Looks like git does not see my working directory and looking somewhere else.
If I run git status
it outputs the same:
nothing to commit (working directory clean)
If I create new branch and edit something, then same thing happens. This started happening when I needed to fix merge clashes. When I wanted to merge my one branch with master branch, I had to manually fix it and I needed my files to look exactly as in that branch overwriting master branch those same files. So I added those files and it let me merge it. But then no matter what I change it shows as there is nothing to commit.
What could be done here?
On branch master Problem it is committed already nothing to commit (working directory clean) if faced this problem then just only use the following command
or
if .git is already there in your dir, then follow:
rm -rf .git/
git init
git remote add origin http://xyzremotedir/xyzgitproject.git
git commit -m "do commit"
git push origin master
Don't try commiting / adding files. Just run the following 2 commands (:
In my case I had previously initialized a git directory where I was trying to create a new one. I just deleted all the old files and started from scratch.
Don't use git commit. Skip commit and it will work.
Just do the
and