Sync Forked Repository With Upstream 🔁✔️
Here's the situation, You have forked a repository on GitHub, you have made your changes and sent a pull request and that request has been merged. Now you want to make further changes, but the repository mentions that you are X commits ahead or/and X commits behind upstream repository. So how do you sync it? You can delete your fork and fork the original repository again, but that is a very tedious thing to do. Here's another way to do this: 1. Clone your fork git clone https://github.com/yourname/repo.git cd yourname/repo 2. Add upstream remote git remote add upstream https://github.com/original-author/repo.git git fetch upstream 3. Ignore all changes in fork and sync with upstream git reset --hard upstream/master git push -f origin master Only do this if you have no changes on your fork that you will like to keep. This will set your fork's master to be the same as upstream's master. Now you are free to make any changes you wish to...