简体   繁体   中英

Removing files from index and gitignore

This is a combination of a number of questions I've seen on stackoverlow, essentially I have a number of files I wish to be on my .gitignore list, so I've added those files manually.

The problem is it appears these files were already indexed before adding them to the gitignore list, so they appeared in the "changes not staged for commit". I wish to remove them completely so git can't see them so I did a 'git rm --cached ' for all of them.

However after doing this when doing a git status I know see them as 'deleted' under 'Changes to be committed' ie staged, if I do a 'git reset HEAD ' it simply moves them back as 'modified' under 'Changes not staged for commit'

All I want to do is ignore them completely, how do I do this?

git rm them, then commit. Until you commit, they'll show up as deleted.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM