gpt4 book ai didi

python - 我不能忽略 Django 上的 pycache 和 db.sqlite,即使它在 .gitignore 中引用它们

转载 作者:太空狗 更新时间:2023-10-29 22:18:14 26 4
gpt4 key购买 nike

我想忽略 Django 项目的 pycache 和 db.sqlite 的变化。我在 .gitignore 中引用它们,但是 git 捕获了它们的变化。如果你知道,你能告诉我什么是问题吗?我在句子末尾附上了我的 .gitignore。

enter image description here.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
media/
settings.py

.idea/

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.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 logs
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:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Database stuff
*.sqlite3
migrations/
db.sqlite3

# Atom config file
.editorconfig

# Other unwanted stuff
.idea
.DS_Store
.DS_STORE

最佳答案

如下,我已经解决了问题。

git rm -r --cached .   # will delete whole git history, use with caution
git add .
git commit -m
git push ~

关于python - 我不能忽略 Django 上的 pycache 和 db.sqlite,即使它在 .gitignore 中引用它们,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40230842/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com