Personally, I prefer this command to be associated with the hub alias, so I can just run:
git hub
And since the folder name is really often the same as the repository name, here's my solution:
git config --global alias.hub '!f () { local REPO;local URL;[[ -f .githubrepo ]] && REPO="$(head -n 1 .githubrepo)" || REPO="${PWD##*/}";URL="https://github.com/<your username>/$REPO";if [[ "$1" == i ]];then URL="$URL/issues";elif [[ "$1" == s ]];then URL="$URL/settings";elif [[ "$1" == p ]];then URL="$URL/pulls";elif [[ "$1" == w ]];then URL="$URL/wiki";elif [[ "$1" == b ]];then URL="$URL/branches";elif [[ "$1" == r ]];then URL="$URL/releases";fi;echo "Opening $URL...";start "$URL";};f'
Make sure you change <your username> to your username.
Now you can run
$ git hub -> opens the repo depending on the folder's name
$ git hub i -> opens issues/
$ git hub p -> opens pulls/
$ git hub s -> opens settings/
$ git hub w -> opens wiki/
$ git hub b -> opens branches/
$ git hub r -> opens releases/
$ git hub whatever -> opens whatever/
If the name of the folder doesn't correspond to the name of the repository, you can add a .githubrepo file and set its content to the name of it, and it'll use this instead.
Hopefully it'll save some people a bit of time
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Personally, I prefer this command to be associated with the
hub
alias, so I can just run:And since the folder name is really often the same as the repository name, here's my solution:
Make sure you change
<your username>
to your username.Now you can run
If the name of the folder doesn't correspond to the name of the repository, you can add a
.githubrepo
file and set its content to the name of it, and it'll use this instead.Hopefully it'll save some people a bit of time