2

I have a git repository where I have kind of a template file which should be customized on a local basis on lots of computers. So what I'd like to achieve is that I add this file to the repository in an initial form, and then set the repository up to ignore any future changes to this specific file.

I've found several article suggesting using the update-index --skip-worktree command, however that works only on a local, per cloned repository basis. What I'd like to have is a repository-level setup which would effect every future checkouts, clones, everything.

I've also tried adding the file to .gitignore after having it in the repository, but that had no effect, git was still tracking it.

Is there any way to achieve this?

Zoltán Tamási
  • 12,249
  • 8
  • 65
  • 93
  • Guessing it's a configuration file of some sorts, you have also found the suggestion to ignore the machine-specific configuration file (e.g. `fooapp.config`) and let users copy `fooapp.config.example` to `fooapp.config` before running the application? – CodeCaster Nov 28 '17 at 16:23
  • [Git - Ignoring a specific modification to a config file](https://stackoverflow.com/questions/15150317/git-ignoring-a-specific-modification-to-a-config-file) – CodeCaster Nov 28 '17 at 16:28
  • @CodeCaster I'd like to avoid manual steps as much as possible, and the config file in this case have to be added to a C# project to be in the build output, so I should have something there as a placeholder at least. But I guess I have to figure it out to do some automation. – Zoltán Tamási Nov 28 '17 at 16:55

0 Answers0