Git - deletes the files in the scratchpad

If you accidentally commit an unwanted file to the git scratchpad, you can delete the file from the scratch area with the git rm command. For example, if you accidentally submit a file called: test.js you can execute a command:

1
git rm --cache test.js

If you want to delete a directory, you need to add the -r parameter. For example, to delete a directory named : target, this can be done:

1
git rm -r --cache target

本文标题:Git - deletes the files in the scratchpad

文章作者:Morning Star

发布时间:2022年01月01日 - 15:01

最后更新:2022年01月07日 - 15:01

原始链接:https://www.mls-tech.info/git/git-remove-from-cache-en/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。