Commit 8546a64d authored by Christoph Häfner's avatar Christoph Häfner

Add more useful git aliases

parent ef975d4b
......@@ -27,11 +27,16 @@
sync = !"git fetch origin; git rebase; git pull"
# Switch to a branch, creating it if necessary
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
# Create a new branch based on origin/master
nb = "!f() { git checkout -b $1 origin/master; }; f"
# Remove branches that have already been merged with master
# a.k.a. ‘delete merged’
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
# get update from upstream and push to github/gitlab-fork
gh-update = "!f() { git checkout master && git reset --hard origin/master && git pull origin && git push github && git push gitlab && git push --tags gitlab; }; f"
# gerrit
push-draft = "!f() { git push origin HEAD:refs/drafts/$1; }; f"
push-gerrit = "!f() { git push origin HEAD:refs/for/$1; }; f"
[core]
# Treat spaces before tabs and all kinds of trailing whitespace as an error
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment