home/git: add rebase-fixups script
This commit is contained in:
10
home/programs/git/scripts/git-rebase-fixups.sh
Normal file
10
home/programs/git/scripts/git-rebase-fixups.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
if [ -n "${1:-}" ]; then
|
||||
TARGET_BRANCH="$1"
|
||||
shift
|
||||
else
|
||||
TARGET_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
|
||||
fi
|
||||
|
||||
FORK_POINT=$(git merge-base --fork-point "$TARGET_BRANCH")
|
||||
|
||||
git rebase "$FORK_POINT" --autosquash "$@"
|
||||
Reference in New Issue
Block a user