Last active
January 7, 2020 02:52
-
-
Save useafterfree/aa1bda9c25e1cc0f80030385db8ff366 to your computer and use it in GitHub Desktop.
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
| function deleteBranch() | |
| { | |
| BRANCH=$1 | |
| git push origin :$BRANCH | |
| git branch -D $BRANCH | |
| } | |
| function renamebranch () { | |
| OLD="$1" | |
| NEW="$2" | |
| git branch -m "$NEW" | |
| git push origin :"$OLD" "$NEW" | |
| } | |
| function remoteresetter () { | |
| COMMIT="$1" | |
| BRANCH="$2" | |
| git reset --hard "$COMMIT" | |
| git push origin HEAD:$BRANCH --force | |
| } | |
| function listbranches () | |
| { | |
| git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))' | |
| } | |
| function createbranch () | |
| { | |
| git checkout -b $1 | |
| git push -u origin $1 | |
| } | |
| function fetchall () | |
| { | |
| git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
| git fetch --all | |
| git pull --all | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment