3
GIT rm filename

remove the file from the index as well as from your working directory. Is it possible to remove the file only from the index ?

thank you, Alessandro DS

Alessandro De Simone
  • 4,085
  • 6
  • 28
  • 41
  • I just answered your question on database.yaml when you deleted it. It was a good question... – VonC Jun 29 '10 at 14:34
  • Sorry, I removed the question because I thought it was a bad question e very bad written. I've rewrote it: http://stackoverflow.com/questions/3142418/files-in-gitignore thank you – Alessandro De Simone Jun 29 '10 at 16:00
  • @aleds: I forgot to mention you could have undeleted your own first question instead of recreating it. Too late now. For what it worth, I have copied my original answer to your new *identical* question. – VonC Jun 29 '10 at 19:26

1 Answers1

7

Use git rm --cached:

--cached

Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285