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
89
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
270
コードレビューを通す技術 / technique to pass code review
oohira
1
78
Progressive OSS Contribution
oohira
1
140
Why Mob Programming?
oohira
3
2k
朝の15分読書会ふりかえり / 15min-reading-retrospective
oohira
0
140
朝の15分読書会のススメ
oohira
0
420
Ansibleで3台のビルドサーバーを3分で構築した話 / Set up build servers in 3 min by Ansible
oohira
0
160
知っておくと便利なcurl
oohira
0
180
git-svnで始めるボッチのためのGit
oohira
0
4.3k
Other Decks in Programming
See All in Programming
意外とフォントが大事だった話 / Font Issues on Internationalization
fumi23
0
110
Increased Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
380
いまから追い上げる、Jetpack Compose トレーニング
nyafunta9858
0
590
開発を加速する共有Swift Package実践
elmetal
PRO
0
420
A New Era of Testing
mannodermaus
2
510
Ruby Parser progress report 2024
yui_knk
2
230
What you can do with Ruby on WebAssembly
kateinoigakukun
0
170
Rechartsで楽にゴリゴリにカスタマイズする!
10tera
1
170
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
210
Method Swizzlingを行うライブラリにおけるマルチモジュール設計
yoshikma
0
120
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
230
私のEbitengineの第一歩
qt_luigi
0
450
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Designing with Data
zakiwarfel
98
5k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
Mobile First: as difficult as doing things right
swwweet
221
8.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
278
13k
Building Applications with DynamoDB
mza
90
6k
Atom: Resistance is Futile
akmur
261
25k
Thoughts on Productivity
jonyablonski
66
4.2k
Navigating Team Friction
lara
183
13k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
25
3.9k
A better future with KSS
kneath
235
17k
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 ࢀߟจݙ