Get the source code

Attribution

The content of this page is largely taken from the GitHub-blog.

Create a fork

Go to the official OGS-6 repository and click the “Fork”-button. This creates a new fork under your account with the URL https://github.com/YOUR-USERNAME/ogs.

Setup your local clone

You can use the git command line tool to clone the remote repository on GitHub to your PC:

This creates a new folder ogs in your current working directory with the OGS source code. After this step, the remote called origin refers to your fork on GitHub. It also sets the default remote for pushes to be origin and the default push behavior to current. Together this means that if you just type git push, the current branch is pushed to the origin remote (git version >= 2.5 required).

Create a second remote called upstream that points at the main OGS repository and fetch from it:

Enable git commit hooks

Git hooks help to check for several issues before doing commits or pushes and it is highly recommended to enable these checks.

Install pre-commit (a git hook manager) via Pythons pip:

Enable the hooks in the source code with:

Optional: Working on a new feature

You only have to follow the above steps once. From then on, whenever you want to work on a new feature, you can more easily interact with the remote repositories.

Make sure that your local repository is up-to-date with the upstream repository:

Create a branch feature-name off of upstream master-branch to work on a new feature, and check out the branch:

This automatically sets up your local new-feature-branch to track the upstream master-branch. This means that if more commits are added to master upstream, you can merge those commits into your feature-branch by typing

or rebase your branch on top of the new master by typing

Now after you implemented the feature and committed your work you can push the new commits to the feature-name-branch on your GitHub fork:

If your work is done submit a pull request.

This workflow is summarized with this picture:


This article was written by Lars Bilke. If you are missing something or you find an error please let us know. Generated with Hugo 0.54.0. Last revision: August 7, 2019
Commit: [web] Added config instructions for the the git hooks. 0f3252a52  | Edit this page on

Creative Commons License | Privacy policy / Legal statements / Impressum