本文介绍了如何忽略文件在〜git中结束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的 .gitignore 文件如下所示:
My .gitignore file looks like that:
> cat .gitignore .bundle db/*.sqlite3 log/*.log tmp/**/* *~但是,git不会忽略以〜结尾的文件:
But, git doesn't ignore the files ended with ~:
> git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: app/views/jobs/_form.html.erb # modified: app/views/jobs/_form.html.erb~ # modified: public/stylesheets/jobs_new_edit.css~这可能是什么原因?
What could be th ereason for that?
推荐答案modified 表示你已经在repo中提交了该文件。您应该先将其删除,然后再将其忽略。
modified means you have the file committed in the repo already. You should remove it first, then it will be ignored for addition.
更多推荐
如何忽略文件在〜git中结束?
发布评论