-
Notifications
You must be signed in to change notification settings - Fork 27
How to contribute
The Enarx project welcomes contributions!
You will find some information here that aims to make it easier for new comers to contribute.
Note: this page is a work in progress
To contribute to this Github repo, you should follow a few recommendations.
You will also need to set up your environment if you haven't already done so. We'll start with this.
Here are a few pointers to help you set up your git envirorment.
- Ensure you have an SSH key set up. If you do not, you can generate one with the following command:
-
ssh-keygen -t ed25519 -C "$(whoami) on $(hostname), generated on $(date -I)"
Then add it to your Github profile.
-
- Fork the desired repo on github.com to your user, to be able to work on your own version of the code before submitting it. On a given repo, use the "fork" button at the top right.
- If you have not already done so, set your username and email:
git config --global user.name "your name"
git config --global user.email "[email protected]"
- Clone your fork locally:
git clone https://github.com/<your_username>/<enarx_repo>
- Add an "upstream" remote to your local git repo:
git remote add upstream https://github.com/enarx/<enarx_repo.git>
- To check the remote repositories:
git remote -v
- Create a branch for your work:
git checkout -b <your_working_branch>
- Make your changes, then add the changed files to the staging area:
-
git add <file>
(orgit add -a
to take into account all modified files, including deletions)
-
- Commit your changes:
git commit -m "commit message here"
- Push your change:
git push
With this, your code is visible in your personal repo on Github and can be shown to others, for instance.
When you consider your code to be ready, you can make a request for that code to be reviewed and, if al goes well, merged into the main code base: a Pull Request (or PR).
On Github, go to your personal repo (the one you git clone
d earlier) and find the branch you worked on. You can see your branches at: https://github.com/<your_username>/<enarx_repo>/branches
.
You can then click on "New pull pequest".
If your PR includes multiple commits, explain what you are trying to achieve, to give context to the reviewers. If your code fixes a specific issue, mentioning that issue (with #issue_number) is helpful too. Once you are ready, click on "Create pull request".
You have just contributed code to the project, thanks!
Our recommendation is to commit incrementally, whether it works or not, and to push it to your personal repo.
When your code is at a point at which you're ready to merge it, squash all the "stream of consciousness" commits into a series of logical commits. This helps maintain a history of code changes that is both truthfull and readable to others.
As the project keeps moving, the code base will change. Once changes have been made to the Enarx repo, to keep your local version of the code up to date:
-
Sync the fork:
git fetch upstream
- Ensure you are on your master branch:
git checkout master
- Make sure your local master branch is up to date with the upstream (that any commits you've made that aren't already in upstream/master are replayed on top of that other branch):
git rebase upstream/master
From then on, you can go on to making changes again on your working branch, committing them etc..