I cloned a repository and edited exactly one file in it, tip.php
, and then added it using git add
. But when I next run git status
I get the following:
$ git status
On branch removeRatings
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: .htaccess
deleted: COPYRIGHT.txt
modified: tip.php
Even though neither .htaccess
or COPYRIGHT.txt
was deleted, as I can see them right in the directory. Anyone have a reason why this would happen? I'm running Git Bash on Windows 8.
This message means that files (or file removals) were added to stage.
Run the following commands.
Now you should see whether they were moved/renamed or just deleted. I suppose that they were moved in some way, maybe by your IDE.
Now the status should be clear and show only your
tip.php
. But if you now see.htaccess
andCOPYRIGHT.txt` in the untracked files, then these files have been changed since the last commit.
If you're sure that you didn't change or delete them and do not want to save changes:
This will reset these files to the state of last commit. Be careful and don't run
git reset --hard
without an argument, as it would completely delete your uncommited changes.