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恢复Force Push内容
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Mark24
July 29, 2019
Programming
0
68
Git恢复Force Push内容
git高级技巧,恢复force push的内容
Mark24
July 29, 2019
Tweet
Share
More Decks by Mark24
See All by Mark24
DSL分享
mark24code
0
120
Rails初探
mark24code
0
43
Anti Hook
mark24code
0
75
Other Decks in Programming
See All in Programming
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
120
AI 開発合宿を通して得た学び
niftycorp
PRO
0
150
Understanding Apache Lucene - More than just full-text search
spinscale
0
130
Codex の「自走力」を高める
yorifuji
0
1.2k
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
260
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.1k
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
140
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
130
OTP を自動で入力する裏技
megabitsenmzq
0
120
条件判定に名前、つけてますか? #phperkaigi #c
77web
1
350
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
350
How to stabilize UI tests using XCTest
akkeylab
0
130
Featured
See All Featured
The browser strikes back
jonoalderson
0
810
Raft: Consensus for Rubyists
vanstee
141
7.4k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
230
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
690
My Coaching Mixtape
mlcsv
0
78
Typedesign – Prime Four
hannesfritz
42
3k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
150
[SF Ruby Conf 2025] Rails X
palkan
2
840
The Spectacular Lies of Maps
axbom
PRO
1
630
GraphQLとの向き合い方2022年版
quramy
50
14k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
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