1

Is it possible to set up something in git so modification to a file would be ignored?

This would be like having .gitignore but for modified files instead of only newly added files. So cloning of repo gives you the file but if you modify it then it doesn't get checked-in by default.

Scenario

I have a repo for Unreal engine project. They have this large .umap binary file that gets modified all the time when user clicks something on map. This causes git to checkin this binary file and blow up the history. The .umap file must exist for project to function but I don't want people to checkin the modified file all the time. I would want people to actually go through hoops before they can submit change in this large binary file.

Shital Shah
  • 63,284
  • 17
  • 238
  • 185

1 Answers1

0

.gitignore wouldn't help, since the file is already tracked.

You can try using git update-index:

git update-index --assume-unchanged -- <file>

That being said, storing that file outside of a git repo, or storing only a reference to a file storage backend with git lfs (as commented by CantSleepNow) is preferable (even though the assume-unchanged would still be needed)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250