Main / Gitignore
WhitelistWhitelist works by placing an ignore all at the top, followed by the inversion bang which whitelists stuff. * !*/ !.gitignore This way, the directories in the top level folder are not blacklisted, and you can get at files underneath. Folders ignoreNote that this will ignore any path with a folder sim/ inside: sim/ but this will ignore just the folder sim/ at the top level (level of .gitignore): /sim/ Cleaning up .gitignoreThe reason to ignore files in Git is so that they won't be added to the repository. If you previously added a file you want to be ignored, then it will be tracked by Git and the ignore rules matching it will be skipped. Git does this since the file is already part of the repository. In order to actually ignore the file, you have to untrack it and remove it from the repository. You can do that by using git rm --cached <filepath>. This removes the file from the repository without physically deleting the file (that’s what the --cached does). After committing that change, the file will be removed from the repository, and ignoring it should work properly. Sometimes it's necessary to do a git add . after the git rm --cached to properly rebuild the index. If all else fails, this looks really scary but it actually seems to work: https://www.git-tower.com/learn/git/faq/ignore-tracked-files-in-git |