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
83
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
bundle-update.pdf
vividmuimui
0
88
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
56
あなたの知らないRuboCopの設定
vividmuimui
0
110
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
110
Jasperはいいぞ!
vividmuimui
0
38
Danger CI
vividmuimui
0
93
lock_diff の紹介
vividmuimui
0
85
mysqlでの全文検索での検索の仕方入門
vividmuimui
0
92
Redashを(少しだけ)使いこなすためのTIPS
vividmuimui
0
140
Other Decks in Programming
See All in Programming
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
9
4.1k
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
440
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
210
雑に思考を整理する技術と効能
konifar
60
29k
2 週間で Twitter Bot を作ってみた
contour_gara
0
610
Ruby GitHub Packages
bkuhlmann
0
630
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
180
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
Anthropic Cookbook のおすすめレシピ
schroneko
7
1k
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
140
Featured
See All Featured
Clear Off the Table
cherdarchuk
84
310k
Designing the Hi-DPI Web
ddemaree
276
33k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
What's in a price? How to price your products and services
michaelherold
237
11k
YesSQL, Process and Tooling at Scale
rocio
164
13k
Thoughts on Productivity
jonyablonski
58
3.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
6
1.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
30
6k
The Cost Of JavaScript in 2023
addyosmani
16
3.9k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
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