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
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
91
Pkl/2024-04-17-llt31
ottijp
0
120
JavaScriptのデバッグ/2023-09-04-llt30
ottijp
0
190
CDK for TerraformでAzureリソースをデプロイする/2023-05-15-llt29
ottijp
1
320
TWELITEへの誘い/2022-12-27-llt28
ottijp
0
180
ビルドツールBazelを触ってみた/2022-09-28-llt27
ottijp
0
210
HashiCorp Vaultを使ったシークレットのセキュアな一元管理 〜Ansibleを添えて〜/2022-07-12-llt26
ottijp
0
180
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
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
690
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
150
🦞OpenClaw works with AWS
licux
1
350
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
200
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
3
340
AI-DLC Deep Dive
yuukiyo
9
5.8k
AI時代になぜ書くのか
mutsumix
0
380
SkillsをS3 Filesに置く時のあれこれ
watany
3
1.5k
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
140
Agentic Elixir
whatyouhide
0
450
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
190
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
1
740
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
230
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Leo the Paperboy
mayatellez
7
1.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Docker and Python
trallard
47
3.8k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
690
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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