Skip to content

Instantly share code, notes, and snippets.

@jonmaim
Created February 1, 2011 08:46
Show Gist options
  • Save jonmaim/805601 to your computer and use it in GitHub Desktop.
Save jonmaim/805601 to your computer and use it in GitHub Desktop.
Git checkout every file with changed file properties (run it in root git dir).
$ git status --porcelain --untracked-files=no | awk '{if ($1 == "M") print;}' | cut -d " " -f 3-20 | awk '{gsub(/ /,"\\ ");print}' | xargs -L 1 git diff --summary | cut -d " " -f 7-20 | awk '{gsub(/ /,"\\ ");print}' | xargs -L 1 git checkout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment