Git: File that must be distributed, but ignored / not reuploaded?

Possible Duplicate:
git: can i commit a file and ignore the content changes?

I have a simple problem, and I hope there’s a simple solution.

  • git hook: ensure each merge into the master has a message also the automatic merges
  • Expand variables on config.xml PhoneGap
  • What's the difference between ~ and ^ in git
  • git difftool --dir-diff is not creating temp files for Beyond Compare 3 to use
  • Gitlab custom hook not running
  • git clone connection refused
  • Using Git (and Tower, great app), I have a repository that has a file that everyone needs to download when they clone the repo, BUT that file should never be reuploaded with changes (because it’s a configurtion file, with database-specific usernames / passwords, and paths) – the changes are made only when used locally.

    What I want to do is ignore whatever change I made locally to that file, so the file won’t get updated when I push changes to my repo. How can this be achieved?

    It should be noted that:

    1. When I clone the repo, the file shows up, but when I ignore it (local only, not via .gitignore) I have to untrack it, and when I do and push changes back to the server, anyone that clones the repo will NOT download the file << undesired behavior.

    2. If I ignore the file but I DON’T untrack it, the file still shows up in my working directory, waiting to be commited << undesired behavior.

  • What's the Git command to determine which commit changed a submodule pointer?
  • Git reversing mistake
  • Visual Studio 2015 (VS2015) - Local Branch - Publish unavailable
  • When will `git pull --rebase` get me in to trouble?
  • Getting an API set up from GitHub
  • Git: move a commit “on top”
  • 2 Solutions collect form web for “Git: File that must be distributed, but ignored / not reuploaded?”

    Commit an example file, gitignore the real name, and have your contributors copy the example into the proper location, then configure it. Alternately, provide a setup script that copies the example and does those steps.

    This is properly addressed with smudge/clean scripts.

    Alternatively, scripts that do the deploy reset the user names and passwords.

    Bending tracking and ignoring is not the way to solve this issue.

    Hope this helps.

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