-
-
Save JohnSundell/4354bbe7f31f66e794da489d4da72183 to your computer and use it in GitHub Desktop.
Script that makes it easy to show a Git repo on GitHub.com
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
#!/usr/bin/env bash | |
# If run without a name, open any current repo | |
if [ -z "$1" ]; then | |
URL=$(git remote get-url origin) | |
URL=${URL/"[email protected]:"/"https://github.com/"} | |
URL=${URL/".git"/""} | |
open $URL | |
else | |
open "https://github.com/$1" | |
fi |
@Abizern @JohnSundell personally I really love writing a bunch of tiny shell scripts for the following reasons:
- great skill to have in your toolbox
- a skill that requires constant practise ;-)
- no installation required, I use Mackup across my machines or download from my GitHub dot files and away I go
- I wrote the code and can see it, easier to customise over time
I have a similar script for opening Xcode from the current directory. Handles multiple projects/workspaces (via option list) etc...
openx
Not the best code but if you want it:
https://gist.github.com/shaps80/9652980
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you use https://github.com/github/hub, then
hub browse
does the same thing. :)