Created
May 31, 2013 19:55
-
-
Save avk/5687564 to your computer and use it in GitHub Desktop.
View the past and present state of deployed files in a git repo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gitat | |
# View the past and present state of deployed files in a git repo. | |
# | |
# Usage: | |
# 1. prints file in currently deployed state | |
# $ gitat path/to/file | |
# 2. prints version of file deployed on May 20 | |
# $ gitat path/to/file 2013-05-20 | |
# 3. prints context around line 123 in version of file deployed on May 20 | |
# $ gitat path/to/file 2013-05-20 123 | |
gitat () { | |
git show origin/master@{$2}:$1 | cat -n | grep -C10 "${3}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment