Staging Deleted files
问题 Say I have a file in my git repository called foo . Suppose it has been deleted with rm (not git rm ). Then git status will show: Changes not staged for commit: deleted: foo How do I stage this individual file deletion? If I try: git add foo It says: 'foo' did not match any files. 回答1: Use git rm foo to stage the file for deletion. (This will also delete the file from the file system, if it hadn't been previously deleted. It can, of course, be restored from git, since it was previously