0

Our team has a project in which a part of a file is different (configuration for the computer in which project is executed.) It is also important that this file has to be present in every branch.

In this situation, is there some way in which git can be used successfully? (Ignoring the file will make git remove the file during checkouts; keeping it under version control will cause trouble while syncing.)

Frog
  • 311
  • 1
  • 10
  • Can the project assume by default that the file is `/home/username/.projectname`? – bereal Aug 21 '15 at 13:05
  • @bereal yes, sort of. The problem is that different people have different usernames. – Frog Aug 21 '15 at 13:08
  • `$USER` and `$HOME`? – bereal Aug 21 '15 at 13:09
  • @bereal I did think about it, but the configuration does not support environment variables. – Frog Aug 21 '15 at 13:10
  • the conf file should be ignore by git and if needed generated from a shared file. For example you commit `config.ini.example` and via a Makefile (ot other) you generate the use file – Ôrel Aug 21 '15 at 13:11
  • @Frog not inside the configuration file, but your application, when it loads the config, it will first check `$HOME/.projectname`. – bereal Aug 21 '15 at 13:11
  • @bereal In my case, that is not possible. I'm looking for a generic solution involving git. – Frog Aug 21 '15 at 13:13
  • Alternatively, load the config from whatever is in `$MYPROJECT_CONFIG` if it is set. – bereal Aug 21 '15 at 13:15

0 Answers0