Last active
May 16, 2023 10:32
-
-
Save Kova93/0e17b8bae31ac384ef5c89b4240cccde 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
[core] | |
longpaths = true | |
[alias] | |
printbranch = branch --show-current | |
nuke = !"git reset --hard; git clean -fdx #" | |
get = !"git fetch origin $1:$1 #" | |
go = !"if [ \"$(git printbranch)\" != \"$1\" ]; then git get $1; git checkout $1; fi #" | |
fp = fetch --prune | |
pullall = !"git pull; git branch -v | grep -Po '(?<=^ )(\\S+)(?=\\s+\\S+\\s+\\[behind \\d+\\])' | xargs -r -L 1 git get #" | |
cleanupbranches = !"git branch -vv | grep ': gone' | awk '{print $1}' | xargs -r -L 1 git branch -D #" | |
cub = cleanupbranches | |
pushnew = !"git push --set-upstream origin $(git printbranch) #" | |
pn = pushnew | |
resolve = !"vim $(git status --porcelain | grep -Po '(?<=^UU ).*') #" | |
smu = submodule update --init --recursive | |
[push] | |
default = simple | |
[log] | |
decorate = auto | |
[pull] | |
ff = only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment