Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Forking on GitHub, step by step

Fork an extension's repository on GitHub, clone it, add the original as upstream, work on a branch and install your fork into an Exponential site with Composer, with the commands and what you should see.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/extension-development/part-5-extend-fork-contribute/forking-on-github.md

On this page

Forking on GitHub, step by step

Part 5, chapter 3. This chapter walks through forking an extension on GitHub and using your fork in a development site. It assumes a GitHub account and Git on your computer (Develop with Git covers Git itself). The example forks se7enxweb/expchangeclass; replace it with the repository you need, and your-account with your GitHub user or organization.

1. Fork on GitHub

  1. Open the repository's page, for example https://github.com/se7enxweb/expchangeclass.
  2. Click Fork (top right).
  3. Choose your account as the owner. Keep the repository name.
  4. Leave "Copy the main branch only" ticked unless you need other branches.
  5. Click Create fork.

You now have https://github.com/your-account/expchangeclass, with the whole history of the original and a note "forked from se7enxweb/expchangeclass" under its name. That note is part of the credit: keep the fork connected, do not "detach" it.

2. Clone your fork

git clone [email protected]:your-account/expchangeclass.git
cd expchangeclass
git remote add upstream https://github.com/se7enxweb/expchangeclass.git
git remote -v

You should see two remotes: origin (your fork, where you push) and upstream (the original, where you fetch from).

3. Work on a branch

Never work on main of your fork. A branch per change keeps each pull request clean:

git switch -c fix-menu-entry-csp
# edit files
git add design/admin/templates/popupmenu/classcontextmenu.tpl
git commit -m "Updated: The context menu entry carries no inline handler"
git push -u origin fix-menu-entry-csp

Name the branch after the change, not after yourself.

4. Use your fork in a development site

A site installed with Composer can take the extension from your fork instead of Packagist. In the site's composer.json:

{
    "repositories": [
        { "type": "vcs", "url": "https://github.com/your-account/expchangeclass" }
    ],
    "require": {
        "se7enxweb/expchangeclass": "dev-fix-menu-entry-csp"
    }
}

Then:

composer update se7enxweb/expchangeclass

dev- plus the branch name installs that branch. Composer reads the package name from the fork's composer.json, which still says se7enxweb/expchangeclass, so the requirement keeps that name. Clear the caches and regenerate the autoloads afterwards, as for any extension change.

Warning

Do not run composer update on a live site to test a fork. Use a development copy. A Composer run can also replace extensions you have checked out with Git by hand; know how your site was installed before you run it.

Without Composer, clone the fork straight into extension/:

cd extension
git clone -b fix-menu-entry-csp [email protected]:your-account/expchangeclass.git expchangeclass

The folder name must be the extension's name (expchangeclass), not the repository's if they differ.

5. From here

What can go wrong

ProblemCauseFix
Permission denied (publickey) on cloneno SSH key on GitHubuse the https URL, or add your key to GitHub
Composer: "could not find a matching version"the branch name in dev-... is wrong, or the fork's composer.json has another namecheck git branch -r and the name field
Your change is not visible on the sitethe site still uses the originalcomposer show se7enxweb/expchangeclass shows the source; clear the caches

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x