我正在做的項目有很多分支,其中有兩個分支我的關注點sprint1
和sprint2
。我從分支sprint1
創建了我的工作lexis
的一個新分支,並將1
分配給分支lexis
。後來我的隊友告訴我應該從sprint2
分支,而不是sprint1
。於是,他做了以下這些git命令是什麼意思,以便讓我的分支與某個遠程分支相同?
On branch lexis he deleted my commit
git fetch origin/sprint2
git reset --hard origin/sprint2
Then he cherry picked my commit from reflog
然後他告訴我,推我的分支lexis
提交使用push -f
。 我的疑惑是
- 我知道正在重置,使我的分支
lexis
酷似sprint 2
。但爲什麼他做了git fetch
? - 爲什麼使用
git psh -f
?