In circumstances where the only thing that changes in the Web.config file is the connectionstrings element (my local machine v.s my collaborators’ machines), I found myself entering the following command before every commit:
git reset HEAD TheNameOfTheWebProject/Web.config
Well, I got sick of typing all that, so I decided to create a simple alias.
git config alias.rew 'reset HEAD TheNameOfTheWebProject/Web.config'
Now my workflow looks like this:
git add -u git rew git commit -m "Some message about changes"
Note, I did not make the alias global, as it only applies to the Web.config of that particular project.
