Skip to content

Instantly share code, notes, and snippets.

@LucianBuzzo
Last active January 17, 2020 10:48
Show Gist options
  • Select an option

  • Save LucianBuzzo/6f00737841500a0c4d857af9ec200dfd to your computer and use it in GitHub Desktop.

Select an option

Save LucianBuzzo/6f00737841500a0c4d857af9ec200dfd to your computer and use it in GitHub Desktop.
git alias'
[alias]
push-force = push --force-with-lease
tree = log --graph --decorate --pretty=oneline --abbrev-commit --all
scratch-commit = commit -m \"fixup\"
signoff = commit --amend --signoff
alias = config --get-regexp ^alias\\.
# from https://gist.github.com/hkaj/97c16a9ec6df6e6f1e18
checkoutpr = "!f() { git fetch origin refs/pull/$1/head:pr/$1; git checkout pr/$1; } ; f"
checkoutcontrib = "!f() { git checkout master && git pull && git remote add $1 git@github.com:$1/dd-agent && git fetch $1 $2 && git checkout -b $3 $1/$2 && git rebase master } ; f"
# from Juanchi
delete-merged-branches = "!f() { git checkout --quiet master && git branch --merged | grep --invert-match '\\*' | xargs -n 1 git branch --delete; git checkout --quiet @{-1}; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment