Last active
July 26, 2023 01:49
-
-
Save sanisoclem/34ee61fbfe5a39c67243be3fcafa5e46 to your computer and use it in GitHub Desktop.
Git Aliases
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
[alias] | |
ls = log --decorate --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" | |
tree = log --oneline --decorate --all --graph | |
acm = !git add . && git commit -m | |
ac = !git add . && git commit | |
acf = !git add . && git commit --fixup HEAD | |
ds = diff --stat | |
dc = diff --cached | |
dcs = diff --stat --cached | |
s = status -s | |
co = checkout | |
cob = checkout -b | |
com = checkout origin/master | |
com2 = checkout origin/main | |
puush = push -u origin HEAD | |
pf = push -f | |
poof = push -f | |
rst = reset HEAD --hard | |
rbmi = rebase origin/master -i --autosquash | |
rbmi2 = rebase origin/main -i --autosquash | |
b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'" | |
cleanup = "!git fetch --prune -v && git co master && git merge origin/master --ff-only && git branch --merged | grep -v '\\*' > /tmp/merged && vi /tmp/merged && xargs git branch -d < /tmp/merged" | |
cleanup2 = "!git fetch --prune -v && git co main && git merge origin/main --ff-only && git branch --merged | grep -v '\\*' > /tmp/merged-main && vi /tmp/merged-main && xargs git branch -d < /tmp/merged-main" | |
sagase = "!f() { git grep -n $1 | while IFS=: read i j k; do git blame -L $j,$j $i | cat; done; }; f" | |
[user] | |
email = dev@jerahmeelcosinas.net | |
name = Jerahmeel Cosinas | |
signingkey = F5A3386CB2A80124 | |
[commit] | |
gpgsign = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment