使git忽略所有目录中vim产生的临时文件(无论是在整个系统中,还是在本地为单个项目),正确的方法是什么? 解决方案
Vim临时文件以〜结尾,因此您可以添加到文件 .gitignore 行
*〜Vim还创建交换文件有swp和swo扩展名。
*。swp * .swo这会忽略单个项目中的所有vim临时文件
如果你想要在全球范围内完成此操作,您可以在家中创建一个.gitignore文件(可以指定其他名称或位置),然后使用以下命令:
git config --global core.excludesfile〜/ .gitignore然后你需要将要忽略的文件添加到该文件中。
What is the correct way to make git ignore temporary files produced by vim in all directories (either globally across the system or locally for a single project)?
解决方案Vim temporary files end with ~ so you can add to the file .gitignore the line
*~Vim also creates swap files that have the swp and swo extensions. to remove those use the lines:
*.swp *.swoThis will ignore all the vim temporary files in a single project
If you want to do it globally, you can create a .gitignore file in your home (you can give it other name or location), and use the following command:
git config --global core.excludesfile ~/.gitignoreThen you just need to add the files you want to ignore to that file
更多推荐
git忽略vim临时文件
发布评论