It appears that I've somehow gotten git
into a state in which it won't commit because a file that's been deleted doesn't exist:
~/src$ git status -u # On branch master # Your branch is ahead of 'origin/master' by 5 commits. # (use "git push" to publish your local commits) # # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # deleted: release-vars.sh # ~/src$ git commit -a fatal: pathspec 'release-vars.sh' did not match any files ~/src$ ls release-vars.sh ls: cannot access release-vars.sh: No such file or directory
Any ideas on how to resolve this situation?
-a
is explicitly telling it to commit the current version of every currently-tracked file from the content in your worktree. It's not quite the same operation as
git add --all
which might be what you're after here. Then do an ordinary commit.
If your .gitignore
specs leave unignored detritus you don't want to track you could instead git rm --cached
the deleted file explicitly so your subsequent git commit -a
doesn't trip over the unexpectedly missing file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With