0

Our master has two files which contain DB settings (application.ini and legacy_bootstrap.ini). Due to some local issues I have had to change my local DB settings and modify these two files to reflect those changes. Both of these files are included in .gitignore but since they are being tracked it doesn't recognize the .gitignore.

I've tried the update-index --assume-unchanged which seems to work fine until I switch branches and then I get an error notice that tells me I have to commit before switching branches. I have also tried the git reset --hard HEADand clear the GIT cache and still the same issues.

Looking for a solution here that would allow the file to remain tracked so that if there are changes I could pull those changes, but ignore my local changes from having to be stashed to switch branches or having to revert the changes to switch branches or even more annoying trying to remember to not push these changes to the repo.

Cory
  • 191
  • 2
  • 10
  • 1
    The proper solution is to track sample versions of those files and not track the files themselves. Duplicate incoming. – ChrisGPT was on strike Jan 15 '15 at 17:05
  • I would have deleted these files from my repo, commited the change and then paste them again in my repo + updated my gitignore. I don't think it's the right solution but that will do the job. – Franck Jan 15 '15 at 20:15
  • **Chris**, I am not sure you what you mean by tracking sample versions... Since these are backbone files that tell all other files the sql info I don't see how I can create say an application_sample.ini file without changing all references to application.ini in other files. **Franck**, As for deleting these files from repo, wouldn't that cause them to be untracked and removed for other users that pull, or are you saying that I should delete -> commit -> replace -> push and then that would cause my .gitignore to then begin to properly ignore? – Cory Jan 15 '15 at 22:07
  • possible duplicate of [How to version control config files pragmatically?](http://stackoverflow.com/questions/1974886/how-to-version-control-config-files-pragmatically) – Sascha Wolf Jan 16 '15 at 08:21
  • While that question asks about SVN the same solution can be applied here. – Sascha Wolf Jan 16 '15 at 08:22
  • Related: http://stackoverflow.com/questions/1396617/committing-machine-specific-configuration-files – Sascha Wolf Jan 16 '15 at 08:22

0 Answers0