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
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
Search
vividmuimui
August 01, 2018
Programming
0
110
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
original
https://vividmuimui.github.io/slides/git-learn-again/slides/
vividmuimui
August 01, 2018
Tweet
Share
More Decks by vividmuimui
See All by vividmuimui
あるチームでの技術選定で考えてること(外部向けに修正版)
vividmuimui
0
8
開発組織まわりで最近考えているあれこれ
vividmuimui
0
16
bundle-update.pdf
vividmuimui
0
120
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
77
あなたの知らないRuboCopの設定
vividmuimui
0
220
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
150
Jasperはいいぞ!
vividmuimui
0
47
Danger CI
vividmuimui
0
110
lock_diff の紹介
vividmuimui
0
96
Other Decks in Programming
See All in Programming
Le côté obscur des IA génératives
pascallemerrer
0
140
CSC305 Lecture 06
javiergs
PRO
0
220
株式会社 Sun terras カンパニーデック
sunterras
0
280
技術的負債の正体を知って向き合う / Facing Technical Debt
irof
0
160
[Kaigi on Rais 2025] 全問正解率3%: RubyKaigiで出題したやりがちな危険コード5選
power3812
0
110
SpecKitでどこまでできる? コストはどれくらい?
leveragestech
0
700
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
190
CSC509 Lecture 04
javiergs
PRO
0
300
10年もののAPIサーバーにおけるCI/CDの改善の奮闘
mbook
0
810
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
250
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
520
overlayPreferenceValue で実現する ピュア SwiftUI な AdMob ネイティブ広告
uhucream
0
180
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.9k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Typedesign – Prime Four
hannesfritz
42
2.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
Navigating Team Friction
lara
190
15k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Context Engineering - Making Every Token Count
addyosmani
5
230
GitHub's CSS Performance
jonrohan
1032
470k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
Transcript
tig とかalias なし生活を送 tig とかalias なし生活を送 ってみて改めてgit を覚えて ってみて改めてgit を覚えて
る話 る話 2018/08/01 社内LT @vividmuimui 1
はじめに はじめに ここ2,3 週間ぐらい、Git/Github の研修資料を作るために、tig やgit alias を封 印してみてます。 その中で今まで知らなかったこと、見たことはあるけど忘れていたものとか
を発表するLT です。 tig については https://qiita.com/vivid_muimui/items/7e7a740e6537749de0c0 2
注意 注意 難しい話とかトリッキーな話とかではないです。基本的な話しかないです! 人によっては当たり前のこと多いかと思いますが! 優しい目で見てください! 3
目次 目次 add -u reset –mixed, –soft, –hard show HEAD~^2~~^~^2
HEAD, @ –staged is a synonym of –cached di topic..master/topic…master 4
add -u add -u 対象となるファイルは と一緒です。 や しか知らなかったので地味に便利かなと思っています。 は少し躊躇するし、 や
などでコンフリクトしてコ ンフリクト解消したときとかにも便利そう( 予感) https://git-scm.com/docs/git-add -u, --update update tracked files 5
reset –mixed, –soft, –hard reset –mixed, –soft, –hard 今回改めて覚えるまで、 デフォルトのオプションがどれかもよくわかってなかったし、
しか普 段使ってなかったので、 と の違いもよくわかったなかったでした。 https://git-scm.com/docs/git-reset 6
reset –mixed, –soft, –hard reset –mixed, –soft, –hard デフォルトは と
どちらかわかりますか? と の違いを理解できますか? 7
reset –mixed, –soft, –hard reset –mixed, –soft, –hard 詳しくは この記事
を! http://d.hatena.ne.jp/murank/20110327/1301224770 --soft --mixed( 同等) --hard 影響度 小 順 以下 --soft HEAD 位置 変更 影響 --mixed ( ) HEAD 位置 変更 影響 --hard HEAD 位置 変更 http://d.hatena.ne.jp/murank/20110327/1301224770 8
show HEAD show HEAD ~ ( ) ~世代前 指定 ^
( ) 複数 親 指定 https://qiita.com/chihiro/items/d551c14cb9764454e0b9 9
show HEAD show HEAD ~ ( ) ~世代前 指定 https://qiita.com/chihiro/items/d551c14cb9764454e0b9
10
show HEAD show HEAD ^ ( ) 複数 親 指定
https://qiita.com/chihiro/items/d551c14cb9764454e0b9 11
show HEAD show HEAD https://qiita.com/chihiro/items/d551c14cb9764454e0b9 12
HEAD, @ HEAD, @ ( ちなみに、1.8.5 は2013 年年末ごろにリリースされてます。) git のv1.8.5
からは、大文字「HEAD 」の4 文字を打たな くて済むよう「@」というエイリアスが用意された http://tech.aainc.co.jp/archives/6740 Instead of typing four capital letters “HEAD”, you can say “@” now, e.g. “git log @”. https://raw.githubusercontent.com/git/git/master/Documentation/RelNotes 13
HEAD, @ HEAD, @ とか書くことができて便利 (rb = rebase) 14
–staged is a synonym of –cached –staged is a synonym
of –cached よりも のほうが絶対理解しやすいはず。 ( なんでcached という名前なのか、は理解してないです ) https://git-scm.com/docs/git-di git diff --cached git diff --staged 15
diff topic..master/topic…master diff topic..master/topic…master ちがいわかりますか? git diff topic master git
diff topic..master git diff topic...master 16
diff topic..master/topic…master diff topic..master/topic…master https://yakst.com/ja/posts/4116 17
git diff foo..bar git diff foo bar 完全 同 2
foo bar 最新 変更同士 違 表示 一方 git diff foo...bar 2 bar 最新 変更 違 表示 通常 2 間 共通 最後 https://yakst.com/ja/posts/4116 18
diff topic..master/topic…master diff topic..master/topic…master github のPR をだすときのURL が のように であることがこれで納得いきますね
https://github.com/foo/bar/compare/branchA...branchB 19
終わり 終わり tig や各種エディタ拡張とかとても便利だし、普段の開発ではalias や peco(history) で特定のコマンドしか使うことないと思います。 素のgit を触ることあまりないとは思いますが、 たまーに素のgit
を触ってみると新しい発見があるかもしれません! ( 読んだほうが早くね!とかそういう系の正論は ) Reference manual 20