许多天前,我fork了Airflow代码库并进行了一些修改,然后提交了一个PR。
但是今天,我想提交另一个PR,所以我需要重新fork最新的Airflow源代码,并且放弃我的所有更改。
一个笨拙的方法是删除我的仓库,然后再次fork官方仓库。实际上,在搜索后,不需要删除和fork。
我尝试过的:
$ git remote add upstream <original-repo-url>
$ git fetch upstream # update local with upstream
$ git diff HEAD..upstream/master # see diffs between local and upstream/master (if there is no diff then both are in sync)
$ git pull upstream master # pull upstream's master into local branch
$ git push origin HEAD # push to your forked repo's remote branch
然而,以这种方式,在git push origin master
之前我必须先进行git commit
,因此我的仓库中会显示一个额外的提交。
我的问题是如何更新派生的存储库,就像一个新的派生存储库一样。