Git 个命令将 fork 恢复到当前源代码(因为它在主存储库中)它是从中分叉的

Git command(s) to restore fork to current source code (as it is in main repository) it was forked from

大约 3 个月前,我在 GitHub 上分叉了一个存储库。我向主仓库提交了一个拉取请求,它是从那里分叉出来的。我想重新开始,因为对原始代码的更新太多了。最好的行动方案是什么?我应该调用什么 Git 命令来获取当前源代码?我还发送了拉取请求,所以我也想撤消(或禁用)这些请求。

这个问题有git变基https://git-scm.com/docs/git-rebase and git merge https://git-scm.com/docs/git-merge。 通过变基,对主分支的提交将应用于您的开发分支。

https://www.atlassian.com/git/tutorials/merging-vs-rebasing/conceptual-overview