git - git clean 和 system rm 的区别

标签 git

有什么区别:

git clean -f temp1.txt

rm temp1.txt

Git 文档说:

git-clean - 从工作树中删除未跟踪的文件

那么这样做的真正意义是什么,而不仅仅是系统命令?

最佳答案

rm 无论如何都会删除文件。 git-clean 只会在它实际上未被跟踪时将其删除。当然,git-clean 也接受以 repo 感知方式自定义其行为的参数(例如 -x)。

关于git - git clean 和 system rm 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14549415/

相关文章:

git - 如何重写 git 历史以匹配流行的 git 工作流程

android - videoplayer 插件不适用于 cordova/phonegap

svn - 处理重命名 : svn vs. git 与 mercurial

git - 在 Colab 中将文件推送到 Git 时出错 : fatal: could not read Username for 'https://github.com' : No such device or address

git - 如何不忽略本地 .gitignore_global 中的项目

仅在 Bower 安装期间 Git 身份验证失败(退出代码 #128)

使用更改 ID 进行 git diff

git - 在 Git diffs 中搜索一个术语时,我可以只显示该术语所在的行吗?

Git clone 工作,但 git pull 不使用 SSH

git - 什么是被子补丁集?