我尝试将文件夹iceberg/static/icon
添加到我的回购邮件中,但这会失败并显示错误:
shen-3:New Platform shen$ git add iceberg/static/icon
The following paths are ignored by one of your .gitignore files:
iceberg/static/icon
这是我的.gitignore。我真的很困惑,我不明白哪个项目与我的文件匹配。
hello/
deploy_server/
gunicorn_start
Vida.env/
# IDE conf
.idea/
.vscode/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
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 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
staticfiles/
local_settings.py
migrations/
# 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
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
还有其他原因吗?
任何有关我的文件夹未被添加的原因的任何见解将不胜感激! :) 谢谢!
您想要的完整网址/Users/shen/Desktop/New Platform/iceberg/static/icon
答案 0 :(得分:3)
要检查导致特定路径被忽略的gitignore
规则,请运行git check-ignore
:
git check-ignore -v path/to/check
man git-check-ignore的更多信息。
答案 1 :(得分:1)
我不确定.gitignore
的哪一行会触发忽略。
但在这种情况下(默认情况下忽略某个文件并且您想要将其全部添加),您始终可以执行以下操作:
git add -v -f iceberg/static/icon
答案 2 :(得分:1)
我遇到了类似的问题,这就是我的解决方法:
您很有可能在.gitignore
拥有一个全局~/.gitignore
文件。在您的~/.gitconfig
文件中,一行像这样:
[core]
excludesfile = /home/userName/.gitignore
从您的配置中删除该行应该可以解决上述问题。
要让Git忽略所有存储库中的某些文件,您可以将该行添加回全局.gitconfig
。
答案 3 :(得分:-2)
将以下行添加到.gitignore
!iceberg/static/icon
bang(!)表示将其包含在.gitignore
:)