After forking a repository on
GitHub, You need to make some changes as a contributions, So you starting with make updates, Then commit it, And finally push them and send a
Pull Request, But the problem that the repository maintainer comment on your PR and tell you that your changes are a head.
So what is the problem?
Usually the problem that your copy of the repository is older than the original repository, In another words, Some changes made to the repository after you forked it and you don’t synced it yet.
So all what you need to do is to sync it, and we will use
CLI to make this.
Change the directory to your local repository:
Add the remote to your repo. and call it
git remote add upstream <original-repo-link>
Fetch all the remote branches:
git fetch upstream
master or main with changes:
git merge upstream/master or main
Now you can push the updated changes to your remote forked repo:
Make sure that you are on the master or main branch
I hope this be useful folks :)
Have a nice time.