Created
February 12, 2021 15:58
-
-
Save ams0/d2a5b0e1dba8f68d986359af610ede1b to your computer and use it in GitHub Desktop.
A script to rebase branch X from branch Y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Usage: gitrebase.sh <branch to rebase into> <branch to rebase from> | |
# $> gitrebase devel main | |
echo "Rebasing branch $1 from branch $2" | |
git checkout $1 | |
git pull | |
git fetch origin $2 | |
git rebase origin/$1 | |
git push -u origin $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment