I have private repos on GitHub. Most are configured by a config.php. This config is excluded is .gitignore, which works fine until the Eclipse with Egit is used as an IDE.
Eclipse + Egit has a not so wonderful feature of randomly trying to include ignored files (and checked by default) when commits are made. Usually this can be caught and unchecked, but is very hard to find when large changes are pushed because it is a lot of files to read through and consider (3rd Friday of the month: deal with all Notice Errors in log files. Usually handled by the noob person)
So in git, we have a pushed commit, filled with great fixes, legitimate files, and one config.php, that if pushed to the server will destroy the database connection string/file locations/ftp credentials/etc, to the users local test config. Amending the file again won't work, it still changes the file on the server. What ever we do should not result in changes or deletions be pushed to the servers in this file.
The previous procedure was delete the commit, then on the submitting machine:
git reset SOFT HEAD^ and then re-apply the changes in the individual files (excluding config.php), but this last round of fixes... well the commit included 142 files! Nobody has time for that.
Is there a means, via github or git, to remove the changes to or exclude config.php that does not remove or change the file from the target server, user(s) machines, or repository??
Again, the file has been committed, pushed (and was caught in the merge process via conflicts). We do not want this file to be modified or deleted upstream, downstream, ever again. This happens about every 3 months with a new person or haste so we plan on using this procedure frequently.
(all previous questions I have read here do not specifically address this situation, or suggest re-doing each of the 142 files)
git rmthe problem file and then stash, go back, get the old stable version and then re-add and merge the changes?