A short guide and a practical reference to GitHub Documentation on syncing a repo.
It's kind of an 'open-source' hacks
For the guide, I'll be using a repo I forked from FbDevcCommunityContent.
From the terminal, I will change my directory to where the project files are:
The first step will be to fetch branches and their commits from the upstream, or the parent repository:
git fetch upstream
After that, ensure that you are at the default repository on your remote repo. In my case, the default branch is master
, and so is the upstream.
To confirm your current branch you are on:
git status
All set so go ahead and merge with the upstream's master branch:
git merge upstream/master
If you haven't made any changes or commits on your master branch, git will automatically merge the repos and it'll be up to date
Once that is done, update your remote files to GitHub:
git add .
git commit -m 'synced repo with upstream'
git push
Well, that's pretty much it. Find the original documentation here: