Skip to content

Instantly share code, notes, and snippets.

Joshua Matthews iCurlmyster

Block or report user

Report or block iCurlmyster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@iCurlmyster
iCurlmyster / git_show_bash.sh
Last active Feb 7, 2018
convenient git show in bash
View git_show_bash.sh
# allows user to git show by the number the commit appears in git log
# 1 is the first commit, 2 is the second, etc...
git_show() {
re='^[0-9]+$'
if ! [[ $1 =~ $re ]]; then
return
fi
sha="$(git log -$1 --format="%H")"
shaSplit=(${sha//\n/ })
git show ${shaSplit[$(($1 - 1))]}
You can’t perform that action at this time.