6 ms·
A bash script to open up the current git branch in my browser. Use it everyday. Great because my company has multiple git submodules in any given project and I
by impalallama 4y ago
A bash script to open up the current git branch in my browser.
Use it everyday. Great because my company has multiple git submodules in any given project and I can use this to watch for pipeline failures and the like.
x=$(git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p')
y=$(git symbolic-ref --short HEAD)
url="https://git.thecompany.com/thecompany/$x/tree/$y"
$(open -a "firefox developer edition" "$url"
- hugolundin 4y agoI use git-open [1] for this – highly recommended. It supports multiple remotes and works great with custom hosted servers out of the box. [1]: https://github.com/paulirish/git-open https://github.com/paulirish/git-open
- eibhinn 4y agoMe too! Though yours looks fancier, is that jumping to a branch? lovely. glo () { xdg-open https://git.thecompany.com/$(git config remote.origin.url |cut -f2 -d: |cut -f1 -d.) }