Created
December 14, 2015 12:16
-
-
Save IanVaughan/19bf2b86142ab2749899 to your computer and use it in GitHub Desktop.
Git scripts to make life easier. Put somewhere in your $PATH, and ensure they are executable `chmod +x`
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/sh -x | |
# Locally delete a upstream merged branch | |
# usage: | |
# merged | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0 | |
CURRENT="${ref#refs/heads/}" | |
git checkout master | |
git pull origin master | |
git branch --delete $CURRENT |
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/sh -x | |
# Rebase current branch against master and (optional force) push to origin | |
# | |
# usage: | |
# rebase | |
# or: | |
# rebase -f | |
git checkout master | |
git pull origin master | |
git checkout - | |
git rebase master | |
git push $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment