Skip to content

Instantly share code, notes, and snippets.

@nvk
Last active Jan 17, 2023
Embed
What would you like to do?

Git(Hub) 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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment