[英]how can I ignore py~ file in github
I have already a .gitignore file in my current working directory. 我的当前工作目录中已经有一个.gitignore文件。 But those py~ is still there
但是那些py〜还在那里
Have I done something wrong ? 我做错了什么吗?
This is how my .gitignore looks like 这就是我的.gitignore的样子
*.pyc
.idea/workspace.xml
*.log
.idea/dataSources.ids
*~
In your .gitignore
file add: 在您的
.gitignore
文件中添加:
*.py~
If you already have a *.py~
in your repository, you need remove those from your repository. 如果您的存储库中已有
*.py~
,则需要从存储库中删除它们。 You can do that via this command (for one file at a time): 您可以通过以下命令来做到这一点(一次只处理一个文件):
git rm <file>
OR this for all with the extension *.py~
或全部使用扩展名
*.py~
git rm -r '*.py~'
If you need to remove files from your repository, you need to follow these steps 如果需要从存储库中删除文件,则需要执行以下步骤
git rm --cached <file>
OR git rm -r '*.py~'
git rm --cached <file>
或git rm -r '*.py~'
.gitignore
.gitignore
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.