Can't get rid of "Changes not staged for commit'

git commit -a -m "message"

The -a option will add all tracked files with modifications


A round about way that worked for me, is to:

  1. recreate the file that I deleted.

  2. git add path/filename

  3. git rm --cached path/filename

  4. delete the file

  5. git add .

  6. git commit --amend # if not on an already pushed branch.


Be sure that you are in the same directory as the file when you run any git commands. Alternatively, you can use a relative or absolute path for files used with git commands. The output from git status should indicate the subdirectory where the file is located. I find it strange that the output you posted here doesn't show that.

Tags:

Git