How to deal with custom configuration on versioned files? – git

This question already has an answer here:

  • How do you deal with configuration files in source control?

    19 answers

  • override git from Xcode with homebrew version
  • Adding git submodule into the root of the repository?
  • Is using `git checkout --theirs <filename>` a legitimate way of resolving a merge conflict?
  • git merge should ignore one directory
  • Interactive adding: Don't add lines with specific pattern
  • Is there a way to remove “pointless” commits from git history?
  • How to setup a git driver to ignore a folder on merge
  • avoid git adding dotfiles, hidden file and tempfiles
  • Merge branches with no “simultaneous” changes and keep branch structure
  • Git Bash - Putty - Not a git repo issue - Windows
  • Git - should I have a different README in each branch?
  • How to find which actual command is executed in terminal
  • One Solution collect form web for “How to deal with custom configuration on versioned files? – git”

    I’m not sure what you mean by “don’t really want to have them moving the .ignore file all that much”, but you should stick with the advice you originally found and put files that shouldn’t be added in the ignore file as intended. That’s what it’s there for and there’s no harm at all in filling it with files that not everyone will have.

    Some other tools you can employ are:

    • commit a template for the config file (for example config.sample) and have your build script do a copy from config.sample to the ignored config if (and only if) it doesn’t already exist
    • enhance your configuration system to include overlays. For example config.local, which is ignored, overrides settings loaded from config.shared which is tracked.
    • enhance your configuration system to allow for includes. For example a line like %include ~/settings which people can put their own config into

    All of those, however, presuppose you’re ignoring a config file which varies by user, because that’s what you should do. 🙂

    Git Baby is a git and github fan, let's start git clone.