🀝🏼 Contribute

Learn how to contribute correctly to projects.

Overview

Contributing to projects

Contributing to projects involves more than just submitting code. Here’s a guide on how to contribute properly, including what to consider regarding code, licenses, and intellectual property:

  1. Code and Licenses

    • Respect Licenses: It is crucial to adhere to the licenses of the project you are contributing to. Each project may have a specific license that dictates how the code can be used, modified, and distributed.
    • Code Becomes Part of the Project: Once your code is accepted and merged into the project, it becomes an integral part of the project. This means that your contribution is no longer solely yours, but part of the project's codebase.
  2. Copyright and Control

    • Loss of Control over Code: By contributing code to a project, you generally relinquish some copyright and control over that code. Intellectual property rights of the code are transferred to the project or the managing organization, according to the established policies.
    • Contributors: As a contributor, it’s important to understand that once your code is part of the project, you do not retain exclusive rights over it. The project community or team may modify, redistribute, and use your code as needed for the project.
  3. Contribution Practices

    • Follow Coding Standards: Make sure to adhere to the style guidelines and best practices set by the project. This includes code formatting, naming conventions, and proper documentation.
    • Reviews and Feedback: Being open to reviews and feedback is essential to ensure your contributions meet the project’s standards. Peer review is a crucial part of the contribution process.
  4. Contribution Process

    • Create Pull Requests: Most projects use pull requests to integrate changes. Be sure to provide a clear and complete description of the proposed changes.
    • Testing and Validation: Ensure your code passes all tests and validations before submitting. This helps maintain the quality and stability of the project.

Contribution standards

To indicate the type of changes you're making in a repository, include one of these emojis at the start of your commit or pull request message. This helps create a more visual and organized repository.

EmojiUnicodeAction / Type
πŸ“U+1F4DDUpdate release notes
✏️U+270FTypo corrections
⬆️U+2B06Major updates or new releases
🚚U+1F69ARedirection/rename changes
πŸ“„U+1F4C4Add licenses, markdowns, etc.
πŸ”¨U+1F528Bug fixes
✨U+2728New features or enhancements
πŸ”§U+1F527Technical improvements or general adjustments
πŸ—‘οΈU+1F5D1 U+FE0FRemove unused code or files
πŸ“šU+1F4DAUpdate documentation
♻️U+267B U+FE0FUse of best practices and code reuse
πŸ‘·U+1F477Troubleshooting issues
🎨U+1F3A8Code refactoring (without changing functionality)
πŸ–ΌοΈU+1F5BCVisual design refactoring
πŸš€U+1F680Performance improvements

Automate your commits

You can easily automate your commits or pull requests by creating a file named commit.sh and running it from your terminal or Git Bash to improve the performance of your commits.

#!/bin/bash

git add .

echo "Select the type of commit:"
echo "1) πŸ“ Update release notes"
echo "2) ✏️ Typo corrections"
echo "3) ⬆️ Major updates or new releases"
echo "4) 🚚 Redirection/rename changes"
echo "5) πŸ“„ Add licenses, markdowns, etc."
echo "6) πŸ”¨ Bug fixes"
echo "7) ✨ New features or enhancements"
echo "8) πŸ”§ Technical improvements or general adjustments"
echo "9) πŸ—‘οΈ Remove unused code or files"
echo "10) πŸ“š Update documentation"
echo "11) ♻️ Use of best practices and code reuse"
echo "12) πŸ‘· Troubleshooting issues"
echo "13) 🎨 Code refactoring (without changing functionality)"
echo "14) πŸ–ΌοΈ Visual design refactoring"
echo "15) πŸš€ Performance improvements"

read -p "Choose an option: " type

case $type in
    1) prefix="πŸ“ update release notes" ;;
    2) prefix="✏️ typo corrections" ;;
    3) prefix="⬆️ major" ;;
    4) prefix="🚚 redirection/rename changes" ;;
    5) prefix="πŸ“„ update docs" ;;
    6) prefix="πŸ”¨ Bug fixes" ;;
    7) prefix="✨ feature" ;;
    8) prefix="πŸ”§ improvement" ;;
    9) prefix="πŸ—‘οΈ remove" ;;
    10) prefix="πŸ“š update docs" ;;
    11) prefix="♻️ use of best practices" ;;
    12) prefix="πŸ‘· troubleshooting" ;;
    13) prefix="🎨 code refactoring" ;;
    14) prefix="πŸ–ΌοΈ design refactoring" ;;
    15) prefix="πŸš€ performance improvements" ;;
    *) echo "Invalid option"; exit 1 ;;
esac

read -p "Enter commit message: " message

git commit -m "$prefix: $message"

Conclusion

Contributing to a project is an opportunity to collaborate and enhance the software, but it also comes with responsibilities and commitments. By following these guidelines, you’ll ensure that your contributions are valuable and effectively integrated into the project.