PDStat
PDStat

Reputation: 5825

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' i.e. 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?

Upvotes: 0

Views: 209

Answers (1)

Fred Foo
Fred Foo

Reputation: 363547

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

Upvotes: 2

Related Questions