My git branches mostly look like this: `jira-token/short-summary`, e.g. `ABC-123/reticulate-splines`. I wanted a quick way to bring up to the corresponding ticket in a web browser with `git jira`.

Here's the alias that I added to my ~/.gitconfig:

```
[alias]
jira = "!v() { \
issue=$(git rev-parse --abbrev-ref HEAD | grep -Eo '^[A-Z]+-[0-9]+'); \
if [ -n \"$issue\" ]; then \
xdg-open \"https://your-account.io.atlassian.net/browse/$issue\" >/dev/null 2>&1 & \
fi; \
}; v"
```

#jira #git

Note: this assumes a Linux / freedesktop.org system. On a Mac, you should be able to replace xdg-open with just open.