Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
git switch & git restore
Search
oohira
January 21, 2020
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
git switch & git restore
oohira
January 21, 2020
More Decks by oohira
See All by oohira
私のエンジニア人生に影響を与えた技術書 / tech books that influenced my engineer life
oohira
1
310
コードレビューを通す技術 / technique to pass code review
oohira
1
140
Progressive OSS Contribution
oohira
1
190
Why Mob Programming?
oohira
3
2.5k
朝の15分読書会ふりかえり / 15min-reading-retrospective
oohira
0
190
朝の15分読書会のススメ
oohira
0
490
Ansibleで3台のビルドサーバーを3分で構築した話 / Set up build servers in 3 min by Ansible
oohira
0
250
知っておくと便利なcurl
oohira
0
280
git-svnで始めるボッチのためのGit
oohira
0
5k
Other Decks in Programming
See All in Programming
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
330
GraphQL の onError と Nullability のこれから
quramy
0
200
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
4
3.5k
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
240
AI Augmentation Techniques with Liberty
ivargrimstad
0
250
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
320
AI-Powered Domain-Driven Design
ziobrando
0
370
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.1k
ActionController meets Protocol Buffers
sorah
1
770
Seven New Principles of Software Engineering
yegor256
0
410
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
250
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
200
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
550
How to Talk to Developers About Accessibility
jct
2
600
Product Roadmaps are Hard
iamctodd
55
13k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
340
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
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 ࢀߟจݙ