gitignore does not ignore folder
I’m guessing this folder has been checked into git before? Run git rm -r –cached <folder> and check again.
I’m guessing this folder has been checked into git before? Run git rm -r –cached <folder> and check again.
This is how you can kind of do it with git filters: Create/Open gitattributes file: <project root>/.gitattributes (will be committed into repo) OR <project root>/.git/info/attributes (won’t be committed into repo) Add a line defining the files to be filtered: *.rb filter=gitignore, i.e. run filter named gitignore on all *.rb files Define the gitignore filter in … Read more
.gitignore tells git which files (or patterns) it should ignore. It’s usually used to avoid committing transient files from your working directory that aren’t useful to other collaborators, such as compilation products, temporary files IDEs create, etc. You can find the full details here.
An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources. https://git-scm.com/docs/gitignore *.json !spec/*.json
Use ! to negate the pattern: *.dll !myfile.dll
This ignores root files & root directories, then un-ignores the root bin directory: /* /*/ !/bin/ This way you get all of the bin directory, including subdirectories and their files.
No you cannot force a file that is already committed in the repo to be removed just because it is added to the .gitignore You have to git rm –cached to remove the files that you don’t want in the repo. ( –cached since you probably want to keep the local copy but remove from … Read more
It would appear that the ** syntax is supported by git as of version 1.8.2.1 according to the documentation. Two consecutive asterisks (“**“) in patterns matched against full pathname may have special meaning: A leading “**” followed by a slash means match in all directories. For example, “**/foo” matches file or directory “foo” anywhere, the … Read more
Make sure that your .gitignore is in the root of the working directory, and in that directory run git status and copy the path to the file from the status output and paste it into the .gitignore. If that doesn’t work, then it’s likely that your file is already tracked by Git. You can confirm … Read more
Github has a great boilerplate .gitignore # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] # C extensions *.so # Distribution / packaging bin/ build/ develop-eggs/ dist/ eggs/ lib/ lib64/ parts/ sdist/ var/ *.egg-info/ .installed.cfg *.egg # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports .tox/ .coverage .cache nosetests.xml coverage.xml # Translations *.mo … Read more