Skip to content
Nirmal Mandal edited this page May 12, 2023 · 1 revision

Contributing to SnapIt

Contributing to SnapIt is fairly easy. This document shows you how to get started

Please note: we have a code of conduct, please follow it in all your interactions with the SnapIt project.

Pull Requests or Commits

Titles always we must use prefixes according to below:

🚀 Feature, ♻️ Refactor, 🩹 Fix, 🧹 Cleanup 📚 Doc

  • 🚀 Feature: Added command
  • ♻️ Refactor: Update function or renamed file
  • 🩹 Fix: Improve flow
  • 🧹 Cleanup: Code Cleanup
  • 📚 Doc: Translate to Portuguese middleware redirect

All pull request that contains a feature or fix is mandatory to have unit tests. Your PR is only to be merged if you respect this flow.

Submitting a Pull Request (PR)

Before you submit your Pull Request (PR) consider the following guidelines:

  1. Search [GitHub Pull Requests][gh_prs] for an open or closed PR that relates to your submission. You don't want to duplicate effort.

  2. Fork this repository.

  3. Make your changes in a new git branch:

    git checkout -b BRANCH_NAME
  4. Create your patch, including appropriate test cases.

  5. Follow our Coding Rules.

  6. Commit your changes using a descriptive commit message that follows our commit message conventions. Adherence to these conventions is necessary because release notes are automatically generated from these messages.

    git commit -a

    Note: the optional commit -a command line option will automatically "add" and "rm" edited files.

  7. Push your branch to GitHub:

    git push origin BRANCH_NAME
  8. In GitHub, send a pull request to snapit:master.

  • If we suggest changes then:

    • Make the required updates.

    • Rebase your branch and force push to your GitHub repository (this will update your Pull Request):

      git rebase master -i
      git push -f

That's it! Thank you for your contribution!

After your pull request is merged

After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:

  • Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

    git push origin --delete my-fix-branch
  • Check out the master branch:

    git checkout master -f
  • Delete the local branch:

    git branch -D my-fix-branch
  • Update your master with the latest upstream version:

    git pull --ff upstream master

If you follow these instructions, your PR will land pretty safely in the main repo!