Created
April 27, 2010 13:16
-
-
Save jeremyf/380717 to your computer and use it in GitHub Desktop.
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
# ~/.gitconfig | |
[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 lighthouse project, your config will need to have set the subdomain and project | |
# If branch begins with a number (0-9), then open that ticket # in Lighthouse | |
# Otherwise, go to milestones/current | |
lighthouse = "! ref=\"milestones/current\"; ticket=$(git branch --contains HEAD | sed -En \"s/^\\* //p\" | grep -e \"^[0-9]\" | awk '{print \"tickets/\"$1}'); if [[ -n \"${ticket}\" ]]; then ref=\"${ticket}\"; fi; open https://$(git config lighthouse.subdomain).lighthouseapp.com/projects/$(git config lighthouse.project)/${ref}" | |
# In my .git/config | |
[lighthouse] | |
project = 49185-map | |
subdomain = agencynd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment