Skip to content

Instantly share code, notes, and snippets.

@bruno-uy
Last active October 18, 2022 14:59
Show Gist options
  • Save bruno-uy/b3f41e941ee9ae928102ea11687f2478 to your computer and use it in GitHub Desktop.
Save bruno-uy/b3f41e941ee9ae928102ea11687f2478 to your computer and use it in GitHub Desktop.
Git good practices

Git good practices

  1. Write meaningful and concise commit message:
    • ❌ "Add new feature"
    • ✅ Changing X and Y because of Z
  2. Follow a pattern / convention for commit messages. You can check a good reference here.
  3. Squash commits you did for testing / adding small changes. You can check how to do that here.
  4. Separate your commits into isolated units of "atomic" changes. Examples:
    • Changes in one class / file
    • Refactor previous to the actual change you'll be doing
    • Changes in one function if the change is considerable
    • Changes that different people could review (you can point the reviewer to just one commit)
  5. If you have an integration with a ticket system (like Shortcut or JIRA), you can normally include a reference to the ticket to make the binding between ticket and commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment