For contributions, we expect you to work on a fork of the keptn/keptn repo. If you are unfamiliar with forks or Pull Request on GitHub, here is some information on the GitHub help pages:
Warning: If you are committing any changes within your fork, you must not commit them to the master branch. Changes on the master branch (even within your fork) can lead to losing your changes when syncing with the upstream repo or to unresolvable merge conflicts.
Table of Contents
-
Fork the keptn/keptn repository on GitHub to your account, then clone the forked repo (do not clone the original keptn/keptn repo), e.g.:
git clone git@github.com:YOUR_USERNAME/keptn.git
-
Add an upstream to keptn/keptn (e.g., for syncing with the upstream afterwards):
git remote add upstream https://github.com/keptn/keptn.git
and verify that there are two upstreams (on your local computer):
git remote -v
Expected output:
origin https://github.com/YOUR_USERNAME/keptn.git (fetch) origin https://github.com/YOUR_USERNAME/keptn.git (push) upstream https://github.com/keptn/keptn.git (fetch) upstream https://github.com/keptn/keptn.git (push)
Whenever you start working on a new feature, make sure that you branch away from the current master branch. The only exception of this is when you are working on a hotfix for a release, then branch away from one of the release branches.
-
Ensure that you have two upstreams: origin (your repo) and upstream (the keptn/keptn repo):
git remote -v
Expected output:
origin https://github.com/YOUR_USERNAME/keptn.git (fetch) origin https://github.com/YOUR_USERNAME/keptn.git (push) upstream https://github.com/keptn/keptn.git (fetch) upstream https://github.com/keptn/keptn.git (push)
-
Fetch changes from the upstream repo:
git fetch upstream
-
Check out your fork's local
master
(orrelease-*
) branch:git checkout master
-
Fetch all changes from the upstreams
master
(orrelease-*
) branch (this overwrites any changes in your local master branch!):git reset --hard upstream/master
-
Push those changes to your repository:
git push -f -u origin master
-
Ensure your forks master branch is up to date (see info above).
-
Create a new branch:
git checkout -b feature/1234/short_feature_description
-
Make changes to that branch
-
Push those changes to your repository:
git push -u origin feature/1234/short_feature_description
-
Create a pull request (see Creating a pull request from a fork) using the GitHub Web UI