Original documentation borrowed from NHCarrigan Docs
This document outlines the general guidelines for contributing to our projects. It serves as a high-level framework for all contributors, whether you’re submitting code, documentation, or other forms of contribution.
All commits must be cryptographically signed using either GPG or SSH. This requirement serves to verify the authenticity and integrity of your contributions.
- For GPG signing, ensure your GPG key is associated with your GitHub account.
- For SSH signing, use a key linked to your GitHub account.
By signing your commit, you are certifying that:
- You have read, understood, and agree to abide by the project's Code of Conduct in its entirety.
- Your contribution and participation align with the principles outlined in the Code of Conduct, including respect for all community members regardless of their identity or background.
- You have the right to submit the contribution under our project license.
- You understand and agree to our contribution terms.
All contributions to our projects, including but not limited to code, documentation, artwork, and other materials, will be licensed under our global software license. By submitting a contribution, you are agreeing to license your work under the terms of this license.
By contributing to our projects, you affirm that:
- You own the copyright to your contribution or have authorization from the copyright owner to submit it under our license.
- Your contribution does not infringe on any third-party intellectual property rights.
- You grant us a perpetual, worldwide, non-exclusive, royalty-free license to use, modify, and distribute your contribution.
Ensure all contributions comply with relevant laws and regulations, including export controls and data protection laws.
-
Navigate to the original repository on GitHub.
-
Click the “Code” button and copy the URL (HTTPS or SSH, depending on your setup).
-
Open your terminal or command prompt.
-
Navigate to the directory where you want to store the project.
-
Run the following command, replacing
<url>with the URL you copied:git clone <url> -
Enter your GitHub credentials if prompted.
Adding the original repository as an upstream remote allows you to easily keep your fork up-to-date.
-
Change into the project directory:
cd <project-name> -
Add the upstream remote:
git remote add upstream <original-repository-url>Replace
<original-repository-url>with the git URL of the original repository. -
Verify the new remote:
git remote -vYou should see entries for both
origin(your fork) andupstream.
Regularly update your fork to incorporate changes from the upstream repository:
-
Fetch the branches and commits from the upstream repository:
git fetch upstream -
Check out your fork’s local main branch:
git checkout main -
Merge changes from upstream/main into your local main branch:
git merge upstream/main
If you encounter any issues during setup:
- Check the project’s FAQ or troubleshooting guide (if available).
- Search for similar issues in the project’s issue tracker.
- If the problem persists, open a new issue with detailed information about the problem and steps to reproduce it.
If an issue has not already been assigned to you:
- Navigate to the project’s issue tracker.
- Browse open issues or use filters to find tasks that interest you.
- Read the issue description thoroughly to understand the requirements and context.
If an issue is already assigned:
- Check the assignee and the last activity date.
- If you’re still interested in contributing, you can:
a. Comment on the issue expressing your interest to collaborate.
b. Reach out to the assigned person to offer assistance or discuss collaboration. - We encourage collaboration and pair programming on complex issues!
- Once assigned, create a new branch in your fork for this specific issue.
- Use a descriptive branch name, e.g., fix/issue-123-button-alignment.
- Make your changes, committing regularly with clear, concise commit messages.
- Push your changes to your fork.
- Open a pull request, using the Pull Request Template when ready for review.
- Provide regular updates on your progress in the issue comments.
- If you encounter obstacles, don’t hesitate to ask for help in the issue thread.
- If you need to step away from an issue, please let us know so it can be reassigned if necessary.
- Try to start working on the issue quickly if possible.
- If you haven’t made progress within a day or two reach out to your fellow team members or Hackathon Leaders for support.
- If you need more time, communicate this in the issue comments.
- We encourage focusing on one issue at a time to ensure quality and timely completion.
- If you want to work on multiple issues, please complete one before beginning another.
- Always be courteous and professional in issue discussions.
- Respect the decisions of project maintainers regarding issue assignments and priorities.
- If you disagree with something, express your thoughts constructively and be open to feedback.
Before starting work, ensure your forked version is up to date with the original repository. If you’ve set up the upstream remote as mentioned in Section 2.2, follow these steps:
- Open your terminal and navigate to your project’s root directory.
- Run the following commands:
git fetch upstream
git merge upstream/main
Always create a new branch for your work:
- Create and switch to a new branch with either the checkout or switch commands.
-
Option 1: Checkout command
git checkout -b <branchname> -
Option 2: Switch command
git switch -c <branchname>
- Follow the branch naming convention: type/description
type:Indicates the nature of the changes (e.g.,feat/,fix/,docs/, refactor)description:A brief, hyphenated description of the changes
Examples:
feat/add-login-pagefix/resolve-memory-leakdocs/update-api-endpoints
-
Make your code changes, following the project’s coding standards and guidelines.
-
Regularly commit your changes with clear, concise messages.
-
Push your changes to your fork periodically:
git push origin <branchname>
When you’re ready to commit your changes:
-
Stage your changes:
git add .Or stage specific files:
git add <file1> <file2> <file3> -
Commit:
git commit
- Follow Conventional Commit standards:
type(scope): descriptionsuch asdocs: update contributing guidelines. - Use the present tense (“Add feature” not “Added feature”)
- Use the imperative mood (“Move cursor to…” not “Moves cursor to…“)
- Limit the first line to 50 characters or less
- Additional information can be included in the body
- Do NOT reference issues/PRs in your commit
Example:
feat: add user authentication system
Implement JWT-based authentication for API endpoints.
-
Check your code against our style guidelines, and then run the a linter if you have one configured to ensure your code complies.
pnpm lint # or the appropriate lint command for your project -
Run any existing tests to ensure your changes haven’t broken anything:
pnpm test # or the appropriate test command for your project -
Add new tests for your changes if applicable.
- Update relevant documentation to reflect your changes.
- If you’ve added new features, include appropriate documentation.
Before submitting a pull request:
- Check that your code adheres to the project’s style guidelines - the linters should pass.
- Ensure the build succeeds.
- Ensure all tests pass.
- Review your changes and commit history.
If you’re unsure about any part of the process or need help, don’t hesitate to check in with the members of our team or our Hackathon leaders!
-
Push your changes to your forked repository:
git push -u origin <branchname>
-usets the upstream, linking your local branch to the remote branchoriginspecifies your forked repository as the destination<branchname>is the name of your local branch
- Ensure the push is successful and your changes appear in your repository on GitHub.
- Navigate to your repository on GitHub
- You should see a prompt to create a pull request for your recently pushed branch. If not, click on the “Pull requests” tab and then the “New pull request” button.
- Ensure the base repository is the original project repository and the base branch is
main. - Select your recently pushed branch as the compare branch.
-
Change the title of your pull request to be a conventional commit message summarizing all changes in that PR
-
Fill out the pull request description with as much information as possible. This typically includes:
- A clear description of the changes
- The issue number(s) your pull request addresses
- Any additional context or explanations
-
Fill out the rest of the pull request form completely.
-
If your changes include visual elements, consider adding screenshots or GIFs to illustrate the modifications.
- Ensure your PR addresses only one issue or adds one feature. If you have made multiple unrelated changes, consider breaking them into separate pull requests.
- Double-check that all tests pass and there are no conflicts with the base branch.
- If your PR is a work in progress, mark it as a draft pull request.
- Keep an eye on your pull request for any comments, requests for changes, or approval.
- Be prepared to make additional commits to your branch if changes are requested.
If you need to make changes to your pull request:
-
Make the required changes in your local branch.
-
Commit the changes.
-
Push the new commits to your fork:
git push origin <branchname>
- The pull request will automatically update with your new commits.
- Be patient. Everyone is likely managing multiple priorities.
- Be open to feedback and willing to make changes.
- Respond promptly to any questions or requests from reviewers.
- If there’s a delay in your ability to respond or make requested changes, leave a comment explaining the situation.
- Once your pull request is approved, a maintainer will merge it into the main project.
- After merging, you can delete your branch from your fork if you won’t be using it anymore.
- Celebrate your contribution to the project!
- All pull requests require at least one approved review before merging.
- The review process helps maintain code quality, consistency, and project standards.
Approved:Your pull request is ready to be merged.Changes Requested:Modifications or additional information is needed before approval.Commented:The reviewer has provided feedback but hasn’t explicitly approved or requested changes.
If changes are requested:
- Read all comments carefully to understand the requested modifications.
- Ask for clarification if any feedback is unclear.
- Make the necessary changes in your local branch.
- Commit and push the changes to update your pull request.
- Respond to each comment, explaining how you addressed the feedback or why you chose a different approach.
- Respond promptly to review comments.
- Be open to constructive criticism and willing to make changes.
- If you disagree with a suggestion, explain your reasoning politely and be open to discussion.
- Use the review process as a learning opportunity to improve your coding skills.
- Complex changes may require multiple rounds of reviews and revisions.
- Stay engaged throughout the process and be patient if additional iterations are needed.
- Take note of common feedback to improve future contributions.
- Consider reviewing other pull requests to gain insights into the project’s standards and practices.