.gitignore invalid

  • When the code is uploaded to a total warehouse, sensitive information can not upload up together. .Gitignore by creating a file in the same directory .git folder under the control which files are not tracked in the file
  • If those sensitive documents have been tracked (add, commit), then .gitignore file those documents it is not useful. You can clear the cache with the following command, and then re-trace file to
git rm -r --cached .
git add .
git commit -m "去敏感"
  • If you execute the above command, or sensitive information can not be removed, then it may be .gitignore rule file writing error: Figure, application-online.properties file which has sensitive information database passwords, I write application-online in .gitignore file. properties, which do not want to be tracked. But! It back / src / main / rules covering the previous rules, resulting in application-online.properties will continue to be versioned.
  • The reason is: .gitignore file rule, the rule of priority behind higher priority than the previous rules.
  • Workaround: both to another location

Guess you like

Origin www.cnblogs.com/Libinkai/p/11517242.html