1

I have an images folder I want to untrack any changes on my local machine but not remove it remotely every time I push to heroku.

I added it to .gitignore and ran git rm --cached images_folder -r but now every time I push to herkou it gets deleted

Any ideas?

gravetii
  • 9,273
  • 9
  • 56
  • 75
Kareem Mohamed
  • 251
  • 3
  • 14

1 Answers1

1

Try git update-index --assume-unchanged <path to images folder>.

This will ask git to temporarily disallow tracking that file. Any changes you make to that file will be ignored by git. When you want to track the changes to the file again, you can do git update-index --no-assume-unchanged <path to images folder> which will start tracking the changes back again.

gravetii
  • 9,273
  • 9
  • 56
  • 75
  • it gives me this error fatal: unable to mark file images_folder – Kareem Mohamed Aug 14 '14 at 10:53
  • http://stackoverflow.com/questions/12920652/git-update-index-assume-unchanged-returns-fatal-unable-to-mark-file – gravetii Aug 14 '14 at 10:55
  • I think it's a heroku problem and it can't be solved! [heroku filesystem](https://id.heroku.com/oauth/authorize?source=devcenter&response_type=code&client_id=b5e08b8831fc26477ce7ed42&redirect_uri=https%3A%2F%2Fdevcenter.heroku.com%2Fauth%2Fheroku%2Fcallback&state=d6c5e2aef9e7c4b88f3f86b8872e6fdc84a2b4ddb22b4ac6&scope=identity) – Kareem Mohamed Aug 14 '14 at 11:11