Delete files from git index when they are already deleted from fs

后端 未结 6 2062
一生所求
一生所求 2020-12-12 13:20

I have a bunch of files deleted from the fs and listed as deleted in git status.

How can I stage this changes faster then running git rm fo

6条回答
  •  暖寄归人
    2020-12-12 14:04

    git commit -a would stage deleted files (as well as modified) and prompt you for your commit message. I usually execute git commit -av (verbose) to also see diffs of modified files.

    From the manual page:

    by using the -a switch with the commit command to automatically "add" changes from all known files (i.e. all files that are already listed in the index) and to automatically "rm" files in the index that have been removed from the working tree, and then perform the actual commit;

提交回复
热议问题