Development with Forks
Last updated on 2026-06-04 | Edit this page
Cheat-sheet showcasing a workflow using forks, and feature branch development within the fork. See the Branching Models: Forking section for more information.
Summary Diagram
sequenceDiagram
accDescr {A sequence diagram showing the steps for using
Forks with the branching model.}
autonumber
participant UM as upstream main
participant GHM as origin main
participant GHF as origin feature
participant M as main
UM ->> UM: #f
Note over UM: Open an Issue for the change
UM -->> GHM: #f
Note right of UM: First time: Fork the repository
GHM -->> M: #f
Note right of GHM: First time: git clone<br/>Then: git pull
create participant F as feature
M ->> F: Create a feature branch:<br/>git switch -c feature
loop
F ->> F: #f
Note over F: Develop changes:<br/>git add<br/>git commit
end
F -->> GHF: #f
Note left of F: Push to GitHub: git push<br/>The first push creates origin feature!
destroy GHF
GHF -->> UM: #f
Note left of GHF: Pull Request and then Merge.<br/>Delete origin feature branch.
UM -->> GHM: #f
Note right of UM: Sync your fork
GHM -->> M: #f
Note right of GHM: git pull
Note over F: Delete branch:<br/>git branch -d feature
box Met Office Repo - GitHub
participant UM
end
box Your Fork - GitHub
participant GHM
participant GHF
end
box Your Working Copy - Local
participant M
participant F
end
Code Example
Open an Issue for the change on the upstream repository (Met Office repository)
First time only: Fork the repository on GitHub by selecting the
Forkbutton on the upstream repository homepage. See the Create a Fork section for more information.-
Clone your fork or update your local fork
First time only:
Then after:
-
Create a feature branch
-
Develop changes
-
Push to GitHub
Open a Pull Request ensuring the target is the upstream Met Office repository. Progress through the review process, and delete the origin feature branch on your fork when the PR is merged.
-
Sync your fork
This covers steps 8 and 9 in the diagram, which can be done either via GitHub or the command line.
Use the command line option below if you are resolving merge conflicts as part of the development or review process.
:::
- Delete the local feature branch in your fork
