Skip to content





Table of Content

This page contains tips I came across.

revert

  • git reset to unstage files git added
  • git checkout . at the project root to revert all local uncommited changes
  • git reset --hard HEAD also reverts back all local changes
  • git clean -fdxn to dry-run clean up of all untracked files (git-tracked-files will remain), and omit -n to execute

naming

Naming tips for branches and labels are:

  • descriptive name, give immediate context for its purpose
    • feature/login
  • use hyphens
    • bugfix/fix-login-issue
  • use prefix or type where appropriate
    • feature/ for developing new features
    • bugfix/ to fix something, and could be associated to an issue
    • release/ to prepare a new release to do tasks for final revisions
  • include ticket numbers
  • use types in commit messages
    • example template - <type>(scope, optional): description
    • example - feat(parser): Add the ability to parse arrays
    • feat: features
    • fix: bug fixes
    • build:
    • chore: refers to tasks that don’t directly affect the code but are necessary for maintenance or development
      • updating build process
      • incorporating new modules
      • configuration changes such as .gitignore updates
      • internal code maintenance such as code clean up
      • changes related to build tools, runners, and other utilities
    • ci:
    • style: for code style changes such as formatting and indentation
    • docs: pertains to documentation updates
    • refactor: denotes code refactoring without adding new features of fixing bugs
    • test: involves adding or modifying tests