Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ghqでソースコードを管理しよう/2021-03-23-llt20
Search
Satoshi SAKAO
March 23, 2021
Programming
340
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ghqでソースコードを管理しよう/2021-03-23-llt20
社内のLTイベント「えるLT Vol.20 オンライン」で発表した資料です
Satoshi SAKAO
March 23, 2021
More Decks by Satoshi SAKAO
See All by Satoshi SAKAO
Testcontainers/2024-11-20-llt32
ottijp
0
95
Pkl/2024-04-17-llt31
ottijp
0
130
JavaScriptのデバッグ/2023-09-04-llt30
ottijp
0
190
CDK for TerraformでAzureリソースをデプロイする/2023-05-15-llt29
ottijp
1
330
TWELITEへの誘い/2022-12-27-llt28
ottijp
0
190
ビルドツールBazelを触ってみた/2022-09-28-llt27
ottijp
0
220
HashiCorp Vaultを使ったシークレットのセキュアな一元管理 〜Ansibleを添えて〜/2022-07-12-llt26
ottijp
0
190
AWSインフラのデプロイをCDKでカイゼンする/2022-03-23-llt25
ottijp
0
120
Amazon Timestreamでデータ補間/2021-12-27-llt24
ottijp
0
120
Other Decks in Programming
See All in Programming
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
13k
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.4k
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
110
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
720
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
120
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
160
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
130
RTSPクライアントを自作してみた話
simotin13
0
620
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
550
Oxcを導入して開発体験が向上した話
yug1224
4
320
スマートグラスで並列バイブコーディング
hyshu
0
250
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.4k
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1033
470k
Mind Mapping
helmedeiros
PRO
1
260
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
160
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Utilizing Notion as your number one productivity tool
mfonobong
4
320
Designing for Performance
lara
611
70k
Context Engineering - Making Every Token Count
addyosmani
9
980
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
780
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Discover your Explorer Soul
emna__ayadi
2
1.1k
So, you think you're a good person
axbom
PRO
2
2.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Transcript
ghqでソースコードを管理しよう Satoshi SAKAO えるLT Vol.20 2021-03-23 1
話すひと 2 🏢 インフォコム株式会社 品質マネジメント推進室 👨🔧 ソフトウェアエンジニア 🛠 JS (ES6)
/ Node.js / GCP / IoT / iOS (Swift) 💖 猫,テクテクライフ(ランク: 19) Satoshi SAKAO @ottijp
git clone • リモートリポジトリをどこにクローンしてますか? • クローンしたリポジトリが点在してませんか? • クローンしたリポジトリに容易にアクセスできますか? 3
ghq • https://github.com/x-motemen/ghq • リモートリポジトリの管理ツール • 特定のディレクトリ構造に従ってクローンしてくれる • Nature RemoのCTOの方がメインコントリビュータ兼スポンサ
4
ディレクトリ構造 5 ~/ghq |-- code.google.com/ | `-- p/ | `--
vim/ `-- github.com/ |-- google/ | `-- go-github/ |-- motemen/ | `-- ghq/ `-- urfave/ `-- cli/ <ghq root> <host> <user> <repo>
demo • vim というテキストエディタのソースをクローンする • GitHubなら <user>/<repo> の省略形式でOK • ghq
get vim/vim 6
課題 • 一元管理はできるようになったが,リポジトリへのアクセスは? • ghq look という機能があるが, リポジトリ名を完全に覚えている必要がある 7
そこで fzf 8 https://github.com/junegunn/fzf
リポジトリのあいまい検索&移動 9 fzf-src() { local selected selected=`ghq list --full-path |
fzf --query="$LBUFFER"` if [ -n "$selected" ]; then BUFFER="builtin cd $selected" zle accept-line fi zle reset-prompt } zle -N fzf-src bindkey '^Xs' fzf-src
demo • ^Xs で検索開始 • fzfで選択したら自動で移動 10
11 やったね 🥴🎉
まとめ • ghq を使ってソースコードを一元管理しよう • fzf は全人類が使おう 12
13 Appendix
install 14 # windows scoop install ghq # mac brew
install ghq # go go get github.com/x-motemen/ghq
リポジトリの削除 • 手動です • rm -rf $(ghq root)/foo/bar/hoge 15
fzf の活用例 • ブックマークのあいまい検索&移動 • 実行可能コマンドのあいまい検索&実行 • https://github.com/junegunn/fzf.vim 16