- 1.0 Prerequisites
- 1.1 Setup Git on your Development Box
- 1.2 Submit your changes
- 1.3 Run Jenkins and System Tests
- FAQs
Contributing to the cortx-motr repository is a three-step process where you'll need to:
Before you begin
Before you set up your GitHub, you'll need to
-
Generate the SSH key on your development box using:
$ ssh-keygen -o -t rsa -b 4096 -C "your email-address"
-
Add the SSH key to your GitHub Account:
- Copy the public key:
id_rsa.pub
. By default, your public key is located at{YOUR_HOME_DIR}/.ssh/id_rsa.pub
- Navigate to GitHub SSH key settings on your GitHub account.
- Paste the SSH key you generated in Step 1.
- Click Add SSH key to store your SSH key.
- Copy the public key:
Before you begin: Update Git to the latest version.
Once you've installed the prerequisites, follow these steps to set up Git on your Development Box:
-
Set up git config options using:
$ git config --global user.name ‘Your Name’ $ git config --global user.email ‘Your.Name@Domain_Name’ $ git config --global color.ui auto $ git config --global credential.helper cache
Before you can work on a GitHub feature, you'll need to clone the cortx-motr repository.
You'll need to Fork the cortx-motr repository to clone it into your private GitHub repository. Follow these steps to clone the repository to your gitHub account:
-
Navigate to the 'cortx-motr' repository homepage on GitHub.
-
Click Fork.
-
Run the following commands in Shell:
git clone --recursive [email protected]:your-GitHub-Id/cortx-motr.git
Or
git clone --recursive https://github.com/your-GitHub-Id/cortx-motr.git
-
Check out to the “main” branch using:
$ git checkout main
$ git checkout -b "your-local-branch-name"
You can make changes to the code and save them in your files.
-
Use the command below to add files that need to be pushed to the git staging area:
$ git add foo/somefile.cc
📃 Notes:
-
Before sending your patches for review, rebase them on top of:
origin/main
-
Then, check them at least with:
$ ./scripts/m0 run-ut
-
Ideally, run the complete tests with:
$ ./scripts/m0 check-everything
-
-
To commit your code changes use:
$ git commit -s -m 'comment'
- enter your GitHub Account ID and an appropriate Feature or Change description in comment. -
Check out your git log to view the details of your commit and verify the author name using:
$ git log
and$git show
📃 Note: If you need to change the author name for your commit, refer to the GitHub article on Changing author info.
-
To Push your changes to GitHub, use:
$ git push origin 'your-local-branch-name'
Your output will look like the Sample Output below:
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 2 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 332 bytes | 332.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
remote:
remote: Create a pull request for 'your-local-branch-name' on GitHub by visiting:
remote: https://github.com/<your-GitHub-Id>/cortx-motr/pull/new/<your-local-branch-name>
remote: To github.com:<your-GitHub-Id>/cortx-motr.git
* [new branch] <your-local-branch-name> -> <your-local-branch-name>
-
Once you Push changes to GitHub, the output will display a URL for creating a Pull Request, as shown in the sample code above.
📃 Note: To resolve conflicts, follow the troubleshooting steps mentioned in git error messages.
-
You'll be redirected to GitHib remote.
-
Select main from the Branches/Tags drop-down list.
-
Click Create pull request to create the pull request.
-
Add reviewers to your pull request to review and provide feedback on your changes.
Creating a pull request automatically triggers Jenkins jobs and System tests. To familiarize yourself with jenkins, please visit the Jenkins wiki page.
Q. How do I rebase my local branch to the latest main branch?
A Follow the steps mentioned below:
$ git pull origin main
$ git submodule update --init --recursive
$ git checkout 'your-local-branch'
$ git pull origin 'your-remote-branch-name'
$ git submodule update --init --recursive
$ git rebase origin/main
Q How do I address reviewer comments?
A If you need to address comments from the reviewer, commit your changes then rebase your patches on top of main. Finally submit your patches with:
$ git push origin -u your-local-branch-name
Github will automatically update your review request.
We thank you for stopping by to check out the CORTX Community. We are fully dedicated to our mission to build open source technologies that help the world save unlimited data and solve challenging data problems. Join our mission to help reinvent a data-driven world.
Please contribute to the CORTX Motr initiative and join our movement to make data storage better, efficient, and more accessible.
Refer to the Motr Coding Style Guide and the CORTX Contribution Guide to get started with your first contribution.
You can reach out to us with your questions, feedback, and comments through our CORTX Communication Channels:
- Join our CORTX-Open Source Slack Channel to interact with your fellow community members and gets your questions answered.
- If you'd like to contact us directly, drop us a mail at [email protected].