As an example, I will use my fork of the LaraSail project.
As of the time being, it is 9 commits behind. In order to get started, you need to do is to clone your fork. You can do that by going to GitHub and clicking on the Clone button:
Once you’ve copied the URL, go to your command line and run the following command:
- git clone firstname.lastname@example.org:bobbyiliev/larasail.git
Note: Make sure to change the link so that it matches your forked repository
Once you’ve cloned the repository,
cd into the directory:
Then add the original repository to your fork as an upstream:
- git remote add upstream email@example.com:thedevdojo/larasail.git
Note: change the details to match the original repository
After that, fetch the latest changes from the original repository:
The next thing that you need to do is to pull the latest changes in order to get your fork up to date:
This could be considered as an optional step, but the last thing that you need to do is to push those changes to your fork on GitHub:
Note: make sure to change main with the name of the branch that you want to sync with.
After that, if you go to your fork in GitHub, you will see a message saying
This branch is even with the_origin_repo_name:main.
I hope that this helps!