Created
August 7, 2009 14:10
-
-
Save jeremyf/163920 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Two spiffy github commands. One is to go to the appropriate branch | |
| # The other is to open up the issues, allowing for passing a param and opening | |
| # the specific issue | |
| [alias] | |
| # Open the current branch on github | |
| hub = "! br=$(git branch --contains HEAD | sed -En \"s/^\\* //p\"); if ! git ls-remote . | grep -q -e \"refs/remotes/.*/${br}\"; then br=\"master\"; fi; open $(git config -l | sed -En \"s%remote.origin.url=git(@|://)(github.com)(:|/)(.+/.+).git%https://\\2/\\4/tree/${br}%p\")" | |
| # Go to the github project's issues | |
| # $ git hub-issue | |
| # => open browser and go to project's issues | |
| # | |
| # $ git hub-issue 32 | |
| # => open in a browser the specific issue # | |
| hub-issue = "!sh -c 'url=$(git config -l | sed -En \"s%remote.origin.url=git(@|://)(github.com)(:|/)(.+/.+).git%https://\\2/\\4/issues/#issue/%p\"); open \"${url}$1\"' -" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment