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
0
280
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
Pkl/2024-04-17-llt31
ottijp
0
18
JavaScriptのデバッグ/2023-09-04-llt30
ottijp
0
81
CDK for TerraformでAzureリソースをデプロイする/2023-05-15-llt29
ottijp
0
69
TWELITEへの誘い/2022-12-27-llt28
ottijp
0
110
ビルドツールBazelを触ってみた/2022-09-28-llt27
ottijp
0
98
HashiCorp Vaultを使ったシークレットのセキュアな一元管理 〜Ansibleを添えて〜/2022-07-12-llt26
ottijp
0
110
AWSインフラのデプロイをCDKでカイゼンする/2022-03-23-llt25
ottijp
0
53
Amazon Timestreamでデータ補間/2021-12-27-llt24
ottijp
0
60
ncurses/2021-05-12-llt21
ottijp
0
150
Other Decks in Programming
See All in Programming
How to improve maintainability and readability of your automated tests? ( #scrumniigata )
teyamagu
PRO
1
140
Documentation testsの恩恵 / Documentation testing benefits
ssssota
1
580
RustでAWS Lambda functionをいい感じに書く
taiki45
2
160
Jetpack Composeとデザインシステム
rmakiyama
0
250
Direct Style Effect Systems The Print[A] ExampleA Comprehension Aid
philipschwarz
PRO
0
420
An adventure of Happy Eyeballs
coe401_
1
460
ts-morphを使ってコードリプレイスとASTへのハードルを下げる!
nyawach
5
340
WebGLで始める コンピュータグラフィックス入門
heller77
0
400
slow types ってなんだろう?
karad
0
210
Long journey of Ruby standard library RubyKaigi 2024
andpad
2
790
mb_trim関数を作りました
youkidearitai
PRO
1
260
Powerfully Typed TypeScript
euxn23
4
1.8k
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Side Projects
sachag
451
41k
Building Adaptive Systems
keathley
32
1.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
The Language of Interfaces
destraynor
151
23k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Ruby is Unlike a Banana
tanoku
96
10k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
Docker and Python
trallard
35
2.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.3k
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