How-to Contribute
Pull requests should be opened to the
develop
branch asmaster
is reserved for releases.
Here are the basics of contributing to GitHub:
- Fork and clone the project
- Set up the project locally
- Create an upstream remote and sync your local copy
- Branch each set of work
- Push the work to your own repository
- Create a new pull request
- Look out for any code feedback and respond accordingly
We follow Vincent Driessen’s branching model: Git flow and Git Flow Hooks by Jaspern Brouwer. These will be great additions to your environment.
The guide sources are written on Markdown format, taking advantage of Jekyll for GitHub Pages.
While in the development stage, you can live preview your work using the GitHub Pages Ruby Gem.
How to start
- fork Kotlin-SCP repository
- clone your fork:
git clone git@github.com:[YOUR-USERNAME]/Kotlin-SCP.git
- enter your local copy:
cd kotlin-scp
- initialize git flow:
$ git flow init
- fetch remote branches:
$ git fetch --all
New section / sub-section
Simply put, every time you want to work on a new section, or add a sub-section, you should start a “feature”:
$ git flow feature start my-new-section
To keep your work safe, don’t forget to publish your feature often:
$ git flow feature publish
Typos / Urgent updates
For typos and any other issues that should not wait for the next release to be fixed, you should start a hotfix:
$ git flow hotfix start
Once you’re ready to merge your work with others, you should go to main repository and open a New Pull Request to the develop
branch. Then, someone will review your work, comment, request changes, and/or simply merge it to branch develop
of the project’s main repository. Hotfixes will be merged both to develop
and master
branches, making changes immediately available. Features become available on the next release.
Remember to keep master
and develop
branches of your fork up to date with the upstream ones.
Testing locally
You can do it using the GitHub Pages Ruby Gem: “A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages.”
Provided that Docker is installed, follow the official GitHub Pages Ruby Gem instructions to build the Docker image and run the server.