Forking Workflow
Last updated on 2025-11-21 | Edit this page
Overview
Questions
- What are the common workflows of the forking branching model?
Objectives
- First learning objective. (FIXME)
Preparation: Make sure that the main is clean, everything is committed.
The forking workflow is popular among open source software projects and often used in conjunction with a branching model.
FIXME: Why?
The focus of this workflow is to keep the “upstream main” stable while allowing anyone to work on their own contributions independently. Contributions are then suggested and accepted via pull requests. There is not necessarily a develop branch, but you may have release branches.

In order to understand the forking workflow, let’s first take a look at some special words and roles needed:
upstream - Remote repository containing the “true copy” origin - Remote repository containing the forked copy Pull request(PR) - Merge request from fork to upstream (a request to add your suggestions to the “original copy”) Maintainer - Someone with write access to upstream who vets PRs Contributor - Someone who contributes to upstream via PRs Release manager - A maintainer who also oversees releases
Example release workflow for the astropy Python package Spacetelescope (STScI) style guide for release workflow
{Alt: A brief
refresher from Git Training: The figure shows the local computer (“You”)
with branch1 that includes three files of which one is indicated as
removed. An arrow from the local computer points to the cloud in which
origin and upstream are located, with a picture of GitHubs Octocat. The
arrow from local points to origin with you/code(branch1), also with
three files of which the same is indicated as removed. Origin has an
arrow pointing to upstream with “PR” written on top of it and a
screenshot of the “merge pull request” button from the GitHub
webinterface. Upstream has spacetelescope/code (main) with the same
three files of which the same file is indicated as removed as in local
and origin.}
FIXME: Remove text from image and add as caption, source?
{Alt: …}
FIXME: Alt text. Remove text from image and add as caption, source?
Exercises
FIXME: More description about what is happening at each step in the solution
Exercise 1: Create and push a feature branch
You will be assigned a number by the instructor/helper. Create a
feature branch based on upstream main. Then create a file in the
trainees folder called hello_NNN.txt using the
number you just got (replace NNN with your number, e.g. 007). Then push
your feature branch out to GitHub.
Exercise 2: Suggest your changes via pull request
Go to your repository (your fork) on GitHub and find the tab called “Pull requests”. Klick the green “new pull request” button. Then find and click the blue link uder “Compare changes” called “compare across fork”. Select your username and branch name from the right menus. Then click the big green button under the menus called “create pull request”.

- First key point. Brief Answer to questions. (FIXME)