Skip to content

Instantly share code, notes, and snippets.

View hamonangann's full-sized avatar

B. Hamonangan hamonangann

View GitHub Profile
@hamonangann
hamonangann / autogitcommit.sh
Created December 28, 2023 09:24
run by ./autogitcommit.sh commit-desc
git checkout -b $1
git add src/
git commit -m "$1"
git fetch upstream
git rebase -s resolve upstream/master
git push --force origin $(git rev-parse --abbrev-ref HEAD)
git checkout master
@hamonangann
hamonangann / autogitrebase.sh
Last active December 1, 2023 01:49
auto git rebase
git checkout $1
git fetch upstream
git rebase -s resolve upstream/master
git push --force-with-lease origin $1
git checkout master
@hamonangann
hamonangann / auto-rebase.sh
Last active September 17, 2023 14:46
Auto-rebase script
set -eo pipefail
while read line;
do
# create file auto-rebase.txt
# fill each line with branch name
# don't forget to end with blank line!
IFS=' '
read -a strarr <<< "$line"
BRANCH="${strarr[0]}"