GitHub Commit guide

Writing good commit messages is an essential skill for maintaining clarity and professionalism in your projects. Here's a guide for writing commit messages for your GitHub project:

1. Follow a Standard Format

A common format is:

<type>: <short description>

Types of Commit Messages:

  • feat: Adds a new feature.
  • fix: Fixes a bug or an issue.
  • docs: Updates documentation.
  • style: Changes in formatting or code style (e.g., removing extra spaces, fixing indentation).
  • refactor: Refactors code without changing functionality.
  • test: Adds or updates tests.
  • chore: Other changes like configuration or dependency updates.

2. Examples for Your Basic Web Development Project

Here are some ideas you can use based on common updates in web development:

HTML

  • feat: Add homepage structure with semantic elements
  • fix: Correct broken links in the navbar
  • style: Improve indentation and readability in index.html

CSS

  • feat: Add responsive design to the homepage
  • style: Optimize CSS for consistent spacing
  • fix: Resolve layout issues on mobile devices

JavaScript

  • feat: Add form validation functionality
  • fix: Correct button click event logic
  • refactor: Simplify DOM manipulation functions

General

  • docs: Update README with project description and setup instructions
  • chore: Add .gitignore file to exclude unnecessary files
  • style: Apply consistent naming conventions across files

3. Use Descriptive Language

Your commit message should clearly explain the purpose of the commit. For example:

  • Good: feat: Implement contact form with validation
  • Bad: Added stuff

4. Split Large Changes

Avoid bundling too many changes into one commit. Break them into smaller, meaningful commits.


5. Write Meaningful Commit Messages for Existing Projects

If you're uploading a completed project:

  • initial commit: Add basic web development project files
  • chore: Upload completed project with HTML, CSS, and JavaScript
  • docs: Include setup instructions in README

Would you like help crafting commit messages for specific files or parts of your project?


If you upload projects weekly, here are some suggestions for commit messages tailored to that workflow:

Weekly Project Uploads:

  1. Initial Upload:

    • initial commit: Upload weekly project files (Week <number>)
    • feat: Add Week <number> project with HTML, CSS, and JavaScript
  2. Updates or Fixes:

    • fix: Resolve issues in Week <number>'s project layout
    • docs: Update Week <number>'s project documentation
  3. Consistency Across Weeks:

    • chore: Organize folders for Week <number> project
    • refactor: Improve structure for Week <number> project files

This structure helps maintain clear versioning and organization in your repository. Let me know if you'd like to create a template for consistent commit messages!

Post a Comment

0 Comments