很多天前,我分叉了 Airflow 存储库,并进行了一些修改,然后提交了 PR。
但今天,我想提交另一个 PR,所以我需要重新 fork 最新的 Airflow 源代码,并放弃我的存储库中的所有更改。
一个笨拙的方法是删除我的存储库,然后再次分叉官方存储库。其实搜索完之后,就不用删除和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
Run Code Online (Sandbox Code Playgroud)
然而,通过这种方式,我必须git commitbefore git push origin …
git ×1