unixorn/git-extra-commands

View on GitHub
bin/git-branch-rebaser

Summary

Maintainability
Test Coverage
#!/usr/bin/env bash
#
# Kicks off an interactive rebase of all the commits on your branch
#
# Copyright 2019, Vengada Rangaraju https://github.com/KarthikRangaraju
# License: Apache 2.0

set -o pipefail

# shellcheck disable=SC2046
exec git rebase -i $(git rev-parse $(git log $(git origin-head)..$(git rev-parse --abbrev-ref HEAD) --oneline | tail -1 | awk '{ print $1 }')^)