Contributing
Fork, branch off main, open a pull request against main — how to get a change into the core or the SDK.
Bug fixes, gamedata updates, new Source2Mod features and docs fixes are all welcome, in both source2mod (the core) and source2mod-sdk. Changes come in as pull requests from your own fork.
Branches
| Branch | What it is |
|---|---|
main | The released line. Pull requests go against main. |
dev | The maintainer's own working branch. It can be rebased or force-pushed at any time — do not base work on it and do not open pull requests against it. |
Workflow
Fork and clone
Fork the repository on GitHub (the Fork button, top right), then clone your fork with its submodules:
git clone --recurse-submodules https://github.com/<you>/source2mod.git
cd source2modFor the SDK, run python tools/deps.py init once afterwards — see
SDK dependencies.
Add the upstream remote
origin is your fork; upstream is the project, where main moves:
git remote add upstream https://github.com/Source2Mod/source2mod.git
git fetch upstreamBranch off main
One branch per pull request, from an up-to-date upstream/main:
git switch -c fix/take-damage-crash upstream/mainCommit, and stay current
Keep commits focused: the first line says what the change does, the body why.
Before opening the pull request, and whenever main moves under you:
git fetch upstream
git rebase upstream/main
git submodule update --init --recursivePush and open the pull request
git push -u origin fix/take-damage-crashGitHub offers to open a pull request; make sure the base is
Source2Mod/<repo>:main. After a rebase, push with
git push --force-with-lease.
What a pull request needs
- It builds on Linux, and on Windows if it touches platform code — see Building.
- It was tested, if it changes runtime behaviour: say how, and on which CS2 build.
- Interfaces stay compatible. Changing an existing
ISource2Mod*interface's layout is a new revision with the old one still served — see Compatibility. That is usually a pull request in both the core and the SDK; link them to each other. - Gamedata has the Linux and the Windows entry, checked against the current build.
- In the SDK, generated schema headers are not edited by hand (change
tools/schemagen), andvendor/khookstays at the commit Metamod:Source pins. - It reads like the code around it: naming, comments, formatting.
By opening a pull request you agree that your contribution is licensed under
the repository's licence (GPLv3, with the exceptions in LICENSE_INFO.txt).
The same guide is in CONTRIBUTING.md in both repositories. Before starting on
something large, ask in the Discord or open an
issue, so it does not collide with work already under way.
Gamedata
The gamedata folder, its JSON format, how files are merged, and how a plugin ships and reads signatures and offsets of its own.
Permissions
Admins, groups and permissions — permission-gated commands, permissions.json, granting at runtime from your own database, and which SteamID a player is checked under.