Git Time Savers
Get's branch, fetches origin, resets hard.
gifu(){
branch=$(git rev-parse --abbrev-ref HEAD);
git fetch origin;
git reset --hard origin/$branch;
print -P "%F{$colorSuccess}=> Git I Fucked Up, reseted your branch%f"
}
Open Project on Github
gop(){
open `git remote -v | sed 's/^.*:/http:\/\/github.com\//' | sed 's/.git .*//' | tail -1`
}
Open Project Issues on Github
gip(){
url=$(git remote -v | perl -n -e 'm{:(.+?).git} && print $1,"\n"' | uniq );
open "http://github.com/$url/issues"
}
Written by Rodolfo Novak
Related protips
3 Responses
gop() doens't work it opens github.com//
over 1 year ago
·
this is better:
gop(){
open git remote -v | sed 's/^.*:/http:\/\/github.com\//' | sed 's/.git .*//' | tail -1
}
over 1 year ago
·
gifu is the best :)
My solution looks like this but it says (and the method name is: grst):
"Good news everyone, you lost everything on branch ${branch}, start over again..."
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Zsh
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#