Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The following paths are ignored by one of your .gitignore files

I tried to add a folder iceberg/static/icon into my repo but this fails with error:

shen-3:New Platform shen$ git add iceberg/static/icon
The following paths are ignored by one of your .gitignore files:
iceberg/static/icon

This is my .gitignore. I am really confused that I don't understand which item matches my file.

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/

Is there any other reason this happens?

Any insight into why my folder isn't being added would be appreciated! :) Thank you!

Full url you want /Users/shen/Desktop/New Platform/iceberg/static/icon

like image 315
fourth Avatar asked Apr 03 '18 19:04

fourth


People also ask

What should I ignore in Gitignore?

gitignore is a plain text file in which each line contains a pattern for files or directories to ignore. It uses globbing patterns to match filenames with wildcard characters. If you have files or directories containing a wildcard pattern, you can use a single backslash ( \ ) to escape the character.

How do I see what files are ignored in git?

Git Ignoring Files and Folders Checking if a file is ignored From Git 1.7. 6 onwards you can also use git status --ignored in order to see ignored files. You can find more info on this in the official documentation or in Finding files ignored by .

Why is my .gitignore file not working?

Check the file you're ignoring Take a good look at your structure, and make sure you're trying to ignore the file that isn't already committed to your repository. If it is, remove the file from the repository and try again. This should fix the Gitignore not working issue.

How do I ignore a .gitignore class file?

The easiest and most common way to ignore files is to use a gitignore file. Simply create a file named . gitignore in the repository's root directory. Then, add names and patterns for any files and directories that should not be added to the repository.


1 Answers

To check what gitignore rule is causing a particular path to be ignored, run git check-ignore:

git check-ignore -v path/to/check

More info at man git-check-ignore.

like image 116
jsageryd Avatar answered Sep 21 '22 00:09

jsageryd