Skip to content

Instantly share code, notes, and snippets.

@jeremyf
Created April 27, 2010 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyf/380717 to your computer and use it in GitHub Desktop.
Save jeremyf/380717 to your computer and use it in GitHub Desktop.
# ~/.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