.gitignore does not take effect
In git, if you want to ignore a file and keep it from being submitted to the version library, you can use the method of modifying the .gitignore file in the root directory (if not, you need to create the file yourself). Each line of this file holds a matching rule such as:
# this is a comment-will be ignored by Git * .a # ignore all files ending with .a! lib.a # except lib.a / TODO # ignore only TODO files in the project root directory, not including subdir/TODObuild/ # ignore all files in the build/ directory doc/*.txt# ignores doc/notes.txt but does not include doc/server/arch.txt
The rules do not explain too much, but sometimes in the project development process, suddenly want to add certain directories or files to the ignore rules, according to the above method definition found that did not take effect, because .gitignore can only ignore those files that were not originally track, if some files have been included in version management, modify .gitignore is invalid. The solution is to delete the local cache (change it to a non-track state), and then submit:
Git rm-r-- cached .git add .git commit-m'update .gitignore'