Skip to content

Instantly share code, notes, and snippets.

@dgageot
Created July 27, 2010 13:35
Show Gist options
  • Save dgageot/492227 to your computer and use it in GitHub Desktop.
Save dgageot/492227 to your computer and use it in GitHub Desktop.
[alias]
wip = !"git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m \"wip\""
unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1"
rb = !"git wip;git rebase -i origin/master;git unwip"
pr = !"git fetch;git wip;git rebase --stat origin;git unwip;git heads"
head = !"git log -n1"
lost = !"git fsck | awk '/dangling commit/ {print $3}' | git show --format='SHA1: %C(yellow)%h%Creset %f' --stdin | awk '/SHA1/ {sub(\"SHA1: \", \"\"); print}'"
heads = !"git log origin/master.. --format='%Cred%h%Creset;%C(yellow)%an%Creset;%H;%Cblue%f%Creset' | git name-rev --stdin --always --name-only | column -t -s';'"
@fcamblor
Copy link

Parameterized rb alias to pass target branch where we want to rebase :

rb = "!f(){ git wip;git rebase -i $1;git unwip; }; f"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment