How can I safely update (pull) a git project, keeping specific files untouched, even if there\'s upstream changes?
myrepo/config/config.php
Is there a way, o
Update: this literally answers the question asked, but I think KurzedMetal's answer is really what you want.
Assuming that:
mastermaster in origin.... you could do:
# Do a pull as usual, but don't commit the result:
git pull --no-commit
# Overwrite config/config.php with the version that was there before the merge
# and also stage that version:
git checkout HEAD config/config.php
# Create the commit:
git commit -F .git/MERGE_MSG
You could create an alias for that if you need to do it frequently. Note that if you have uncommitted changes to config/config.php, this would throw them away.