从Git远程存储库中删除.pyc文件 [英] Remove .pyc files from Git remote repository

查看:274
本文介绍了从Git远程存储库中删除.pyc文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

偶然地,我将.pyc文件推送到主存储库。现在我想删除它们,但我无法做到。有什么方法可以直接从Bitbucket站点中删除它们?



预先感谢。

解决方案使用 git rm * .pyc删除 .pyc 文件

    。如果这不起作用,请使用 git rm -f * .pyc
  1. 提交 git commit -a -m'移除所有pyc文件'

  2. 推送 git push
  3. 在将来的提交中,您可以通过创建 .gitignore .pyc 文件c $ c> file


Accidentally, I have pushed the .pyc files to the master repository. Now I want to delete them but I can´t do it. Is there any way to remove them directly from the Bitbucket site?

Thanks in advance.

解决方案

  1. Remove .pyc files using git rm *.pyc. If this not work use git rm -f *.pyc
  2. Commit git commit -a -m 'all pyc files removed'
  3. Push git push
  4. In future commits you can ignore .pyc files by creating a .gitignore file

这篇关于从Git远程存储库中删除.pyc文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆