How to use Git to sync forked repositories
Overview
This post describes how to use git
to sync forked repositories.
Background
I frequently need to look up the exact series of commands needed to sync with an upstream repository. This post is primarily for my convenience, but may be useful to others as well.
Fork
Fork the repository by clicking [ Fork ] from your source code repository website. We’ll use SOME-REPO
, in this example.
Clone
Create a local clone of your fork and configure git
to sync your fork with the original:
|
|
Contribute
Hack on code in your fork; make Pull Requests / Merge Requests.
Sync
Sync your fork to keep it up-to-date with the upstream repository:
|
|
Simplify
Assign a git
alias to perform the sync steps for you:
|
|
Usage:
|
|
Summary
Perform the Fork & Clone steps once for each forked repository. Contribute regularly. Sync often.
((( - Party like a rock star! - )))
References
| Github Bootcamp / Fork A Repo
| Github Guides / Forking Projects
| Gitlab / How to fork a project