Many days ago, I forked the Airflow repo and I modified a little then submitted a PR.
But today, I want to submit another PR, so I need to re-fork the latest Airflow source code, and discard all the changes in my repo.
A clumsy way is to delete my repo, then fork the official repo again. Actually, after searching, it doesn't have to delete and fork.
What I tried:
$ 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
In this way, however, I have to git commit
before git push origin master
, so there is an additional commit showing in my repo.
My question is how can I update the forked repo, just like a newly forked repo.
Reference
How to synchronize fork with original GitHub project? How do I update a GitHub forked repository?