Permalink
Browse files

add git-fixup and git-squash

  • Loading branch information...
koffeinfrei committed Sep 19, 2018
1 parent 0d2c8aa commit 55d54c5c201b398dca1af359f44e0a5161c17bfa
Showing with 21 additions and 0 deletions.
  1. +3 −0 .gitconfig
  2. +10 −0 bin/git-fixup
  3. +8 −0 bin/git-squash
@@ -38,6 +38,9 @@
pf = push --force-with-lease
who = shortlog -ns --
alpha = !~/src/git-alpha/git-alpha
default-branch = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
fixup = !git-fixup
squash = !git-squash
[core]
excludesfile = ~/.gitignore
editor = vim
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -eu
default_branch=$(git default-branch)
git --no-pager log $default_branch.. --pretty=format:"%h %s" |
selecta |
awk '{print $1}' |
{ read commit; git commit --fixup $commit; }
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eu
default_branch=$(git default-branch)
first_commit=$(git --no-pager log $default_branch.. --pretty=format:%h | tail -1)
git ri $first_commit~1

0 comments on commit 55d54c5

Please sign in to comment.