日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【Git】从Git远程存储库中删除所有.pyc编译文件;附常用gitignore配置

發(fā)布時間:2024/2/28 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Git】从Git远程存储库中删除所有.pyc编译文件;附常用gitignore配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

問題

提交的時候使用git add --all,然后把所有文件都推送到了遠程倉庫中。

現在我想在遠程倉庫中刪除它們,例如*.pyc文件。

解決方式

git rm *.pyc --cached

刪除的時候,如果遇到報錯fatal: pathspec 'xxx.pyc' did not match any files的情況,可能是因為沒提交…我解決方式是commit一下,然后push上去,就好了,不知道為啥。有可能是因為.gitignore沒有提交,占用了某些文件吧。

附:常用的.gitignore配置

# Created by .ignore support plugin (hsz.mobi) ### Python template # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class *.pyc# C extensions *.so# Distribution / packaging .Python build/ develop-eggs/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg# PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec# Installer log pip-log.txt pip-delete-this-directory.txt# Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/# Translations *.mo *.pot# Django stuff:local_settings.py# Flask stuff: instance/ .webassets-cache# Scrapy stuff: .scrapy# Sphinx documentation docs/_build/# PyBuilder target/# Jupyter Notebook .ipynb_checkpoints# pyenv .python-version# celery beat schedule file celerybeat-schedule# SageMath parsed files *.sage.py# Environments .env .venv env/ venv/ ENV/# Spyder project settings .spyderproject .spyproject# Rope project settings .ropeproject# mkdocs documentation /site# mypy .mypy_cache/.idea .update migrations

總結

以上是生活随笔為你收集整理的【Git】从Git远程存储库中删除所有.pyc编译文件;附常用gitignore配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。