To sync a forked github repo with the upstream repository, use the following steps:
- Go to your forked repository on github.com.
- Click the Compare button.
- Change the base fork to your repository.
- Click Compare across forks.
- Change the head fork to the upstream repository.
- Create a PR and merge into your repository.
- To fix "This repository is 1 commit ahead of upstream repository", in TortoiseGit, right-click the folder and select TortoiseGit->Show log.
- Right-click the previous log entry (the one before your sync merge commit), and select Reset master to this.
- Select Hard.
- Click OK.
- Right-click the folder and select TortoiseGit->Push.
- Checkmark the option to the right of Force and set known changes.
- Click OK.
Your forked repository should now be perfectly synchronized with the upstream repository.