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恢复Force Push内容
Search
Mark24
July 29, 2019
Programming
78
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git恢复Force Push内容
git高级技巧,恢复force push的内容
Mark24
July 29, 2019
More Decks by Mark24
See All by Mark24
DSL分享
mark24code
0
140
Rails初探
mark24code
0
65
Anti Hook
mark24code
0
87
Other Decks in Programming
See All in Programming
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
290
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
580
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
370
Java 27新機能 / Java 27 new features
kishida
2
190
Intent as Code
shoppingjaws
6
1.1k
カツオ、ご期待ください
suneo3476
0
130
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
280
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
210
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
360
Featured
See All Featured
How Software Deployment tools have changed in the past 20 years
geshan
2
34k
Code Reviewing Like a Champion
maltzj
528
40k
Utilizing Notion as your number one productivity tool
mfonobong
4
610
Exploring anti-patterns in Rails
aemeredith
4
520
30 Presentation Tips
portentint
PRO
1
410
Optimising Largest Contentful Paint
csswizardry
37
4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
It's Worth the Effort
3n
188
29k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
730
Designing Experiences People Love
moore
143
24k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
330
Transcript
Git 远程恢复被force-push的队友的commit 2019.07.29 @mark
情景⼀一
情景⼀一:彼此没有沟通,A、B各⾃自依次force push的了了代码。 远程仓库显示了了最后的B的提交。 请问如何,恢复A的部分commit? 开发A 开发B 远程仓库 19:00 pm force
push 19:50 pm force push
⽅方法⼀一 ⽤用户A解决
经过沟通,开发者A可以cherry-pick或者rebase,把⾃自⼰己的本地 提交,和远程分⽀支,进⾏行行处理理,再进⾏行行后续的追加提交。
⽅方法⼆二 中央仓库解决
远程机器器,git reflog ,使⽤用cherry-pick恢复。 实际上这个不不合理理。中⼼心节点,不不应该操作。 其实我不不太清楚,中央节点,有没有reflog,应该是有的 中央仓库解决
⽅方法三 ⽤用户B解决
1.本地reflog仅仅是⾃自⼰己的——⽆无法下载到远程的reflog。这条 路路不不通。 2.⽆无法QQ远程共享屏幕帮A操作,假设A还离职了了,还删除了了 远程仓库(Hard模式) B在本地⽆无记录的情况下如何恢复A的部分节点? B的Hard模式
Git-apply Git-am
1.中央仓库是有记录的。 2.查看想要找回的commit 3.下载patches⽂文件 4.本地使⽤用 git apply 针对单个⽂文件 5.本地使⽤用 git am
针对单⽂文件、⽬目录(批量量⽂文件) 6.区别am会⽣生成commit节点。这个就是我们想要的
问题解决 The End