Last active
March 14, 2023 08:36
-
-
Save favio41/31dc9e19faf074e126a8c9ff061b564a to your computer and use it in GitHub Desktop.
Alias for .gitconfig
This file contains hidden or 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] | |
ready = !"git fetch --all && git checkout develop && git pull --rebase && git fetch-main && git branch --no-color | grep -v main | grep -v develop | xargs -r git branch -D" | |
graph1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
graph2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
graph = !"git graph1" | |
fetch-develop = fetch origin develop:develop | |
fetch-master = fetch origin master:master | |
fetch-main = fetch origin main:main | |
amend = commit -a --amend | |
undo = reset --soft HEAD~1 | |
ignored = git ls-files -v | |
forget = update-index --assume-unchanged | |
unforget = update-index --no-assume-unchanged | |
sync-branch = !git pull && git remote prune origin | |
tag-push = "!f(){ git push origin master --no-verify && git tag \"$1\" && git push --tag \"$1\"; };f" | |
amend-to = "!f() { SHA=`git rev-parse \"$1\"`; git commit --fixup \"$SHA\" && GIT_SEQUENCE_EDITOR=true git rebase --interactive --autosquash \"$SHA^\"; }; f" | |
up = pull --rebase --autostash | |
clean-branches = !"git fetch -p && for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do git branch -D $branch; done" |
You can also edit using: vim ~/.gitconfig
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
git config --global --edit
to edit the config file.