| English | 中文 |
Fork + PR is suited for open-source projects and external contributor scenarios.
Its core principle is: contributors develop in their own forks, then request maintainers to merge via PRs, eliminating the need for direct write access to the main repository.
fork upstream -> create branch -> commit -> open PR -> maintainer review -> merge
git clone git@github.com:your-name/project.git
cd project
git remote add upstream git@github.com:owner/project.git
git switch -c docs/update-guide
Sync with upstream:
git fetch upstream
git rebase upstream/main
Push to your own fork:
git push -u origin docs/update-guide
Then open a PR from the GitHub page.
Contributors should sync upstream/main regularly.
Maintainers can ask contributors to split the PR.
PRs from forks require attention to CI permissions and secret exposure risks, especially when automated scripts execute code from external contributors.
If all enterprise members are within the same organization, defaulting to the Forking Workflow is usually unnecessary.
However, in these scenarios, forks still hold value:
For purely internal business services, feature branch + protected main is often simpler.