Skip to content

Instantly share code, notes, and snippets.

@milosjanda
Last active August 26, 2020 13:45
Show Gist options
  • Save milosjanda/a7461ec6a5474fc98e131d19d4a805fc to your computer and use it in GitHub Desktop.
Save milosjanda/a7461ec6a5474fc98e131d19d4a805fc to your computer and use it in GitHub Desktop.
Git aliases
[alias]
br = branch
brd = branch -d
brD = branch -D
# brp = "!git branch --merged | grep -v '\\*\\|development' | xargs -n 1 git branch -d"
brp = !git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -D
brv = !git -P branch -va
bru = !git fetch && git reset origin/$(git branch --show-current) --hard
ci = commit
co = checkout
cp = cherry-pick
df = diff
dfc = diff --cached
dfw = diff --word-diff
dump = cat-file -p
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
pp = pull --prune
puf = push -f
rba = rebase --abort
rbc = rebase --continue
rbm = !git fetch && git rebase -i origin/master
rbi = rebase -i
rh = reset HEAD
rhh = reset --hard HEAD
rhs = reset --soft HEAD^1
st = status
type = cat-file -t
aap = !git add . && git commit --amend --no-edit && git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment