Skip to content

Instantly share code, notes, and snippets.

Last active May 22, 2023 07:38
What would you like to do?

Git(Hub) Time Savers

Get's branch, fetches origin, resets hard.

    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

	open `git remote -v | sed 's/^.*:/http:\/\/\//' | sed 's/.git .*//' | tail -1`

Open Project Issues on Github

	url=$(git remote -v | perl -n -e 'm{:(.+?).git} && print $1,"\n"' | uniq );
	open "$url/issues"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment