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
git switch & git restore
Search
oohira
January 21, 2020
Programming
0
120
git switch & git restore
oohira
January 21, 2020
Tweet
Share
More Decks by oohira
See All by oohira
私のエンジニア人生に影響を与えた技術書 / tech books that influenced my engineer life
oohira
1
300
コードレビューを通す技術 / technique to pass code review
oohira
1
97
Progressive OSS Contribution
oohira
1
150
Why Mob Programming?
oohira
3
2.2k
朝の15分読書会ふりかえり / 15min-reading-retrospective
oohira
0
160
朝の15分読書会のススメ
oohira
0
460
Ansibleで3台のビルドサーバーを3分で構築した話 / Set up build servers in 3 min by Ansible
oohira
0
210
知っておくと便利なcurl
oohira
0
220
git-svnで始めるボッチのためのGit
oohira
0
4.7k
Other Decks in Programming
See All in Programming
Understanding Ruby Grammar Through Conflicts
yui_knk
1
140
Infer入門
riru
4
1.6k
AIエージェント開発、DevOps and LLMOps
ymd65536
1
350
TDD 実践ミニトーク
contour_gara
0
150
The State of Fluid (2025)
s2b
0
200
『リコリス・リコイル』に学ぶ!! 〜キャリア戦略における計画的偶発性理論と変わる勇気の重要性〜
wanko_it
1
600
Nuances on Kubernetes - RubyConf Taiwan 2025
envek
0
200
SOCI Index Manifest v2が出たので調べてみた / Introduction to SOCI Index Manifest v2
tkikuc
1
110
RDoc meets YARD
okuramasafumi
3
140
decksh - a little language for decks
ajstarks
4
21k
UbieのAIパートナーを支えるコンテキストエンジニアリング実践
syucream
2
730
The state patternの実践 個人開発で培ったpractice集
miyanokomiya
0
150
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
Site-Speed That Sticks
csswizardry
10
790
Navigating Team Friction
lara
189
15k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
480
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Practical Orchestrator
shlominoach
190
11k
Faster Mobile Websites
deanohume
309
31k
Designing for Performance
lara
610
69k
Typedesign – Prime Four
hannesfritz
42
2.8k
Speed Design
sergeychernyshev
32
1.1k
Writing Fast Ruby
sferik
628
62k
Transcript
switch & restore ϏΞόογϡେฏ !PPIJSB
4VCKFDU<"//06/$&>(JUW 'SPN+VOJP$)BNBOPHJUTUFS!QPCPYDPN %BUF'SJ "VH 2 5XPOFXDPNNBOETHJUTXJUDIBOEHJUSFTUPSFBSFJOUSPEVDFEUP TQMJUDIFDLJOHPVUBCSBODIUPXPSLPOBEWBODJOHJUTIJTUPSZBOE DIFDLJOHPVUQBUITPVUPGUIFJOEFYBOEPSBUSFFJTIUPXPSLPO BEWBODJOHUIFDVSSFOUIJTUPSZPVUPGUIFTJOHMFHJUDIFDLPVU
DPNNBOE
• HJUTXJUDI • ϒϥϯνΛมߋ͢Δૢ࡞ • HJUSFTUPSF • ϑΝΠϧΛมߋ͢Δૢ࡞ ˞·ͩFYQFSJNFOUBMɻHJUDIFDLPVU͑Δ 3
HJUDIFDLPVU͕େ͖͍͔Βׂ
• ϒϥϯνͷΓସ͑ • ϒϥϯνͷ࡞ˍΓସ͑ • ͭલͷϒϥϯνʹΔ 4 HJUTXJUDI $ git
switch topic # git checkout topic $ git switch -c topic # git checkout -b topic $ git switch - # git checkout -
• ϑΝΠϧͷϩʔΧϧͷमਖ਼Λ͢ • ϑΝΠϧΛಛఆͷίϛοτʹ͢ 5 HJUSFTUPSF $ git restore
README # git checkout -- README $ git restore --source <commit> README # git checkout <commit> -- README
• εςʔδϯάΤϦΞʹ͋ΔϑΝΠϧΛ͢ • εςʔδϯάΤϦΞϩʔΧϧ͢ 6 HJUSFTUPSF $ git restore
--staged README # git reset README $ git restore --source HEAD --staged --worktree README # git reset --hard README
7 ઈରDPͷํ͕ଧ͍ͪ͢ $ vi ~/.gitconfig ... [alias] co = checkout
sw = switch
• )JHIMJHIUTGSPN(JU5IF(JU)VC#MPH • IUUQTHJUIVCCMPH IJHIMJHIUTGSPNHJU • (JUHJUTXJUDI%PDVNFOUBUJPO • IUUQTHJUTDNDPNEPDTHJUTXJUDI •
(JUHJUSFTUPSF%PDVNFOUBUJPO • IUUQTHJUTDNDPNEPDTHJUSFTUPSF 8 ࢀߟจݙ