Created
September 14, 2023 15:02
-
-
Save jsugarman/649b0dbf4c4d2a59e1f235105b0f452b to your computer and use it in GitHub Desktop.
Git related shell alias and functions
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
# ---------------------------------------------- | |
# git related aliases | |
# ---------------------------------------------- | |
alias gb='git branch -v' | |
alias glp='git log --first-parent --pretty=format:"%h - %an, %ar : %s"' | |
alias gl='git log --pretty=format:"%h - %an, %ar : %s" $(git symbolic-ref refs/remotes/origin/HEAD | sed "s@^refs/remotes/origin/@@")...' | |
alias gil='git log --pretty=format:"%h - %an, %ar : %s"' | |
alias gls='git log --pickaxe-regex -S' | |
alias gd='git diff' | |
alias gs='git show' | |
alias gpl='git pull' | |
alias grb='for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r' | |
alias gst='git status' | |
alias git_del_merged='git branch --merged | egrep -v "(^\*|master|dev|develop|trunc|main)" | xargs git branch -d' | |
alias gdm='git branch -r | awk "{print $1}" | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | egrep -v "(^\*|master|dev|develop|trunc|main)" | awk "{print $1}"' | |
# find commit by message | |
function gfc() { | |
git log --all --grep="$1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment