I've added files under version control. Now I need to remove them from version control and ignore in my project. Is it enough to just put those files inside .gitignore
or I have to delete them first? What's the correct procedure?
If you want to remove the file from git while leaving it in your working directory, you need to git rm --cached
the file, then commit. If you just add the file to .gitignore
, the current version of the file will remain in git.
Yes, .gitignore
is it enough (if you just want do not track this files) But if you want delete it from your project and from git - delete files
Thats all ;)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.