4
2

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.

ghqで管理し始めて、とりあえずやること

Last updated at Posted at 2018-12-22

ghq、便利ですよね。
https://github.com/motemen/ghq

とりあえずghqを入れたらやること的なことを書きます。

自分のリポジトリを全部取ってくる

curl -s "https://api.github.com/user/repos?access_token=(GITHUB TOKEN)&type=all"|jq -r 'map(.ssh_url)[]' | ghq import

GitHub Tokenを入れれば、自分と関係あるリポジトリを全て取ってくる。

リポジトリ移動にpecoを使う

.zshrc
alias gv='cd $(ghq list -p | peco)'

peco使うと、いい感じに絞り込んでくれるので便利です。

branch移動にもpecoを使う

.zshrc
alias gch='git branch -a --sort=-authordate | peco | xargs git checkout'

checkoutもpeco頼り。

ghq-foreach.shを入れる

https://qiita.com/uasi/items/610ef5745fc35745fd54
pullとか全部にやってくれるので便利。

ghq-foreach

上のshell scriptは並列にやってくれなくて時間がめちゃくちゃかかるようになってしまったので、goで並列に実行するようにガッと書き直したやつ。
コマンド互換性はまだ取ってないので、そのうち直す。

4
2
1

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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?