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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Satoshi SAKAO
March 23, 2021
Programming
0
330
ghqでソースコードを管理しよう/2021-03-23-llt20
社内のLTイベント「えるLT Vol.20 オンライン」で発表した資料です
Satoshi SAKAO
March 23, 2021
Tweet
Share
More Decks by Satoshi SAKAO
See All by Satoshi SAKAO
Testcontainers/2024-11-20-llt32
ottijp
0
77
Pkl/2024-04-17-llt31
ottijp
0
110
JavaScriptのデバッグ/2023-09-04-llt30
ottijp
0
180
CDK for TerraformでAzureリソースをデプロイする/2023-05-15-llt29
ottijp
1
300
TWELITEへの誘い/2022-12-27-llt28
ottijp
0
180
ビルドツールBazelを触ってみた/2022-09-28-llt27
ottijp
0
200
HashiCorp Vaultを使ったシークレットのセキュアな一元管理 〜Ansibleを添えて〜/2022-07-12-llt26
ottijp
0
170
AWSインフラのデプロイをCDKでカイゼンする/2022-03-23-llt25
ottijp
0
110
Amazon Timestreamでデータ補間/2021-12-27-llt24
ottijp
0
120
Other Decks in Programming
See All in Programming
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
760
CSC307 Lecture 09
javiergs
PRO
1
840
AI & Enginnering
codelynx
0
120
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
160
今から始めるClaude Code超入門
448jp
8
8.9k
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
310
Oxlint JS plugins
kazupon
1
980
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
590
Featured
See All Featured
A Soul's Torment
seathinner
5
2.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Mobile First: as difficult as doing things right
swwweet
225
10k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
170
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
380
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
110
The agentic SEO stack - context over prompts
schlessera
0
640
Making Projects Easy
brettharned
120
6.6k
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