Skip to content

Instantly share code, notes, and snippets.

@ArthurSonzogni
Created May 23, 2017 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArthurSonzogni/899418ad7a3361fbe224d31e393c6bd4 to your computer and use it in GitHub Desktop.
Save ArthurSonzogni/899418ad7a3361fbe224d31e393c6bd4 to your computer and use it in GitHub Desktop.
#!/bin/bash
# +---------------------------------------+
# | Open commit's files as buffers in vim |
# +---------------------------------------+
if [ -z $1 ]
then
# No argument provided => use the latest commit's files.
commit=HEAD
else
commit=$1
fi;
files=$(git diff-tree --no-commit-id --name-only -r $commit)
vim ${files}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment