How to sync fork in Git
When you fork a repository on GitHub, your fork quickly falls behind the original as new commits are merged upstream.
As the creator of CoreUI, I sync contributor forks daily across multiple repositories and have refined the process to a few reliable steps.
The correct approach is to add the original repository as a remote called upstream, fetch its changes, and merge or rebase them into your local branch.
This keeps your fork current and prevents difficult merge conflicts later.
How to set upstream branch in Git
Setting an upstream branch establishes a tracking relationship between your local branch and a remote branch, allowing you to use git push and git pull without specifying the remote and branch name. As the creator of CoreUI, I use upstream branches daily for streamlined workflows.
The most effective command is git push -u origin branch-name which pushes and sets upstream in one operation.