1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

hub browse のように gitlabやgithubのremoteアドレスからWebへジャンプするalias

Posted at

やりかた

fish

~/.config/fish/config.fish
alias gibr='git remote get-url origin | sed -e \'s/ssh:\/\/git@/https:\/\//g\' -e \'s/:[0-9]\{2,\}//g\' -e \'s/.git$//g\' | xargs -I \{\} open {}'

bash

~/.bash_profile
alias gibr='git remote get-url origin | sed -e \'s/ssh:\/\/git@/https:\/\//g\' -e \'s/:[0-9]\{2,\}//g\' -e \'s/.git$//g\' | xargs -I \{\} open {}'

使う時

$ cd {.git があるディレクトリへ移動}
$ gibr

概要

リモートのgitリポジトリを参照したい時に、わざわざWebで検索していました。

githubでは、hubコマンドによってリンク出来ますが、gitlabでは対応していません。
sshで登録されたリポジトリだった場合色々と置換しなければ行けないのでalias化しました。

以上

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?