. Gitignore Failure Background:
A new project was created on the local Mac using unity, and a commit is initialized with GIT init to initialize the project to the repository. Then, join the. gitignore file and commit again. Then submit the entire warehouse to GitHub.
From the win clone Repository, use Unity to modify the project and discover that files ignored in the. gitignore file are tracked, that is, the. gitignore file "fails".
Reason:
The. gitignore file is cached, at the time of the first commit, all the files are on track and the second commit is added. Gitignore is already late, so it appears to be "dead".
Workaround:
Can clear the cache, this is more troublesome.
The easy way is to delete all the files involved in the. Gitignore in the project folder, then commit and push to remote. In this way, the changes to these files will no longer be track.
Experience:
Before Git init, prepare the. gitignore file in the project, and let the. gitignore file initialize with the project, submitting only the Critical Items section, which ensures that the. Gitignore is valid and the warehouse is clean.
. Gitignore Failure Problem Resolution