Skip to content

Instantly share code, notes, and snippets.

@incik
Last active October 16, 2017 20:05
Show Gist options
  • Save incik/3a7a6ef797b69500c956ca28b9536708 to your computer and use it in GitHub Desktop.
Save incik/3a7a6ef797b69500c956ca28b9536708 to your computer and use it in GitHub Desktop.
Git aliases
[alias]
up = pull --rebase --autostash
br = branch
st = status
ci = commit
ciam = commit --amend --no-edit
co = checkout
pf = push --force-with-lease
pb = "!git push -u origin \"$(git rev-parse --abbrev-ref HEAD)\""
clean-local = "!git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d"
pr = "!open \"$(git remote -v | grep origin | grep push | cut -f 2 | cut -d \" \" -f 1 | sed -e \"s|git@\\(.*\\):\\(.*\\).git|https://\\1/\\2|\")/compare/master...$(git rev-parse --abbrev-ref HEAD)?expand=1\""
prb = "!open \"$(git remote -v | grep origin | grep push | cut -f 2 | cut -d \" \" -f 1 | sed -e \"s|git@\\(.*\\):\\(.*\\).git|https://\\1/\\2|\")/compare/$(git rev-parse --abbrev-ref HEAD)%0Dmaster\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment