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:

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:

git rm -r --cache target

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

文章作者:Morning Star

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

最后更新:2022年01月11日 - 18:01


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