Last active
June 5, 2018 17:12
-
-
Save Serchinastico/98cea9fcc2733689e63c57191257bd2c to your computer and use it in GitHub Desktop.
Alias for easier git rebase --onto
This file contains 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
[alias] | |
# ronto stands for "rebase --onto". Uses the current branch to move it and updates the start-of-the-branch tag along | |
ronto = "!f() { \ | |
git rebase --onto $1 __start__$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --abbrev-ref HEAD); \ | |
git tag -d __start__$(git rev-parse --abbrev-ref HEAD); \ | |
git tag __start__$(git rev-parse --abbrev-ref HEAD) $1; \ | |
}; f" | |
# nb stands for "create branch". Creates a tag marking the start-of-the-branch | |
cb = "!f() { \ | |
git tag __start__$1; \ | |
git checkout -b $1; \ | |
}; f" | |
# db stands for "delete branch". Deletes the tag and the branch itself | |
db = "!f() { \ | |
git tag -d __start__$1; \ | |
git branch -D $1; \ | |
}; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment