git pull --rebase lost commits after coworker's git push --force

后端 未结 4 717
情话喂你
情话喂你 2020-12-01 19:47

I thought I understood how git pull --rebase was working, but this example is confusing me. I would have guessed that the following two scenarios would produce identical res

4条回答
  •  一生所求
    2020-12-01 20:25

    Yeah, this looks right. Brian's git push --force is going to set the latest commit as the one he has on his local system. If Brian had first pulled any latest commits and then git push --force the results would be the same.

    Here is a good thread with more info: Force "git push" to overwrite remote files

提交回复
热议问题