1

I have 2 git repos, I have for example folder1. When i do git rm --cached folder1 and then push the changes and then pull them from the other repo, it deletes them from the other repo. I have added it previously however I no longer with to track the files in this folder. Is there an easy way to remove them from the git inex on both sides without actually deleting them?

1 Answers1

1

If you want to stop tracking changes in a sub-folder in your local copy do this:

git update-index --assume-unchanged <files/to/stop.tracking>

To reverse that do:

git update-index --no-assume-unchanged <files/to/stop.tracking>

Read more here.

Ofir Farchy
  • 7,657
  • 7
  • 38
  • 58