Revert files with changed mode

Sometimes (due to mismanagement!) end up with files in a git repo which have had their modes changed, but not their content. This one-liner lets me revert the mode changes, while leaving changed-content files be, so I can commit just the actual changes made.

git diff --numstat | awk '{if ($1 == "0" && $1 == "0") print $3}'  | xargs git checkout HEAD

Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Popular Posts