Last active
August 29, 2015 14:07
-
-
Save rondy/9e9067c1e7888b658523 to your computer and use it in GitHub Desktop.
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
gpfb() { | |
git add . && git commit --amend -C HEAD && git push -f | |
} | |
# Public: Go to a git branch from a given partial name. | |
# | |
# $1 - The branch partial name. | |
# | |
# Examples | |
# | |
# $ gtb wip | |
# # Switched to branch 'rs-wip-feature-branch' | |
gtb() { | |
local remove_leading_whitespace="s/^ *//" | |
git br | grep $1 | head -1 | sed remove_leading_whitespace | xargs git checkout | |
} | |
# Public: Publish the current branch to a remote. | |
# | |
# Examples | |
# | |
# $ gpb | |
# # Counting objects: 185, done. | |
# # Delta compression using up to 2 threads. | |
# # ... | |
gpb() { | |
local remove_current_branch_indicator="s/^\*//" | |
local remove_leading_whitespace="s/^ *//" | |
git br | grep '\*' | sed remove_current_branch_indicator | sed remove_leading_whitespace | xargs git push -u origin | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment