All Projects → qoomon → git-conventional-commits

qoomon / git-conventional-commits

Licence: other
Git Conventional Commits Util to generate Semantic Version and Markdown Change Log and Validate Commit Messag

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to git-conventional-commits

commithelper
A tool to create and lint commit messages
Stars: ✭ 35 (-39.66%)
Mutual labels:  git-hooks, commit-message, conventional-commits
change
A simple tool that automates generating and updating a changelog
Stars: ✭ 47 (-18.97%)
Mutual labels:  changelog, conventional-commits
Chyle
Changelog generator : use a git repository and various data sources and publish the result on external services
Stars: ✭ 137 (+136.21%)
Mutual labels:  generator, changelog
Git Changelog
Automatic Changelog generator using Jinja2 templates.
Stars: ✭ 30 (-48.28%)
Mutual labels:  generator, changelog
parse-commit-message
(!! moved to tunnckoCore/opensource !! try `parse-commit-message@canary`) Parse, stringify or validate a commit messages that follows Conventional Commits Specification
Stars: ✭ 31 (-46.55%)
Mutual labels:  commit-message, conventional-commits
Maintainer
👨‍💻 🐳 Generate personal daily reports or summary, AUTHORS, CONTRIBUTING, CHANGELOG and so on for GitHub user or repository.
Stars: ✭ 152 (+162.07%)
Mutual labels:  generator, changelog
Github Changelog Generator
Automatically generate change log from your tags, issues, labels and pull requests on GitHub.
Stars: ✭ 6,631 (+11332.76%)
Mutual labels:  generator, changelog
git
🔀 semantic-release plugin to commit release assets to the project's git repository
Stars: ✭ 235 (+305.17%)
Mutual labels:  changelog, conventional-commits
cocogitto
The Conventional Commits toolbox
Stars: ✭ 242 (+317.24%)
Mutual labels:  changelog, conventional-commits
sv4git
Semantic version and conventional commits for git
Stars: ✭ 33 (-43.1%)
Mutual labels:  changelog, conventional-commits
awesome-starless
A curated list of awesome repositories with few stargazers but has a huge users.
Stars: ✭ 38 (-34.48%)
Mutual labels:  repository
roda
RODA - Repository of Authentic Digital Objects
Stars: ✭ 54 (-6.9%)
Mutual labels:  repository
Border-Radius-Generator
A CSS3 Border Radius Generator; Get the best border-radius playground, with a minimalist design!
Stars: ✭ 19 (-67.24%)
Mutual labels:  generator
commitiquette
Plugin for Commitizen that uses commitLint configuration
Stars: ✭ 24 (-58.62%)
Mutual labels:  conventional-commits
crafting
Website for generating Minecraft crafting recipe JSON files
Stars: ✭ 31 (-46.55%)
Mutual labels:  generator
dispatcher
Find potential GitHub projects to contribute to.
Stars: ✭ 33 (-43.1%)
Mutual labels:  repository
wolmo-bootstrap-react-native
Bootstrap generator for React Native projects
Stars: ✭ 20 (-65.52%)
Mutual labels:  generator
justgo
Skeleton for jump-starting a Go-powered microservice project with Docker and Go best-practices + easy code hot-reloading (for dev environments)!
Stars: ✭ 29 (-50%)
Mutual labels:  generator
unity-plumber
A component to procedurally generate pipe-like meshes in Unity
Stars: ✭ 55 (-5.17%)
Mutual labels:  generator
mestral
Simple hook management for Git
Stars: ✭ 55 (-5.17%)
Mutual labels:  git-hooks

Git Conventional Commits Sparkline

npm

Have a look at Git Commit Conventions

Changelog

see CHANGELOG.md

Install

npm install --global git-conventional-commits

Usage

  • Create config file git-conventional-commits init
  • Adjust config git-conventional-commits.json to your needs

Commands

add help parameter -h to commands to list all possible options

  init [options]                               creates a config file template `git-conventional-commits.json`
  version [options]                            determine version from conventional commits
  changelog [options]                          generate change log from conventional commits
  commit-msg-hook [options] <commit-msg-file>  check for conventional commit message format

Config File

Example git-conventional-commits.json

{
  "convention" : {
    "commitTypes": [
      "feat",
      "fix",
      "perf",
      "refactor",
      "style",
      "test",
      "build",
      "ops",
      "docs",
      "merge"
    ],
    "commitScopes": [],
    "releaseTagGlobPattern":  "v[0-9]*.[0-9]*.[0-9]*",
    "issueRegexPattern": "(^|\\s)#\\d+(\\s|$)"
  },

  "changelog" : {
    "commitTypes": [
      "feat",
      "fix",
      "perf",
      "merge"
    ],
    "includeInvalidCommits": true,
    "commitScopes": [],
    "commitIgnoreRegexPattern": "^WIP ",
    "headlines": {
      "feat": "Features",
      "fix": "Bug Fixes",
      "perf": "Performance Improvements",
      "merge": "Merged Branches",
      "breakingChange": "BREAKING CHANGES"
    },

    "commitUrl": "https://github.com/ACCOUNT/REPOSITORY/commit/%commit%",
    "commitRangeUrl": "https://github.com/ACCOUNT/REPOSITORY/compare/%from%...%to%?diff=split",
    "issueUrl": "https://github.com/ACCOUNT/REPOSITORY/issues/%issue%"
  }
}

  • convention

    • commitTypes an array of expected commit types
      • show warnings for unexpected types
      • if not set or empty commit type validation is disabled
      • e.g. ["feat", "fix", "doc", "style"]
    • commitScopes an array of expected commit types
      • show warnings for unexpected scopes
      • if not set or empty commit scope validation is disabled
      • e.g. ["ui", "database"]
    • releaseTagGlobPattern glob pattern to filter for release tags
      • release tags must contain semantic version ([0-9]+\.[0-9]+\.[0-9]+)
      • default *
    • issueRegexPattern regex pattern to find issue IDs
      • e.g. Jira issue pattern [A-Z]{3,}-\\d+
  • changelog

    • commitTypes filter commits by type
      • a subset of convention.commitTypes plus
        • merge commits
      • if not set or empty commit type filter is disabled
      • e.g. ["feat", "fix", "merge"]
    • commitScopes filter commits by scopes
      • a subset of convention.commitScopes
      • if not set or empty commit scope filter is disabled
      • e.g. ["ui"]
    • includeInvalidCommits include commits without valid type: default: true
      • if set to false all commits with undefined commitTypes will be removed from changelog
    • commitIgnoreRegexPattern filter commits by commit subject regex
      • default ^WIP
    • headlines a map of headline identifier and actual headline
      • a subset of changelog.commitTypes plus
        • breakingChange Breaking Changes Section
      • e.g. { "feat": "Features", "fix": "Bug Fixes", "breakingChange": "BREAKING CHANGES"}
      • default { "feat": "Features", "fix": "Bug Fixes", "merge": "Merged Branches", "breakingChange": "BREAKING CHANGES"}
    • commitUrl an URL template for generating markdown links to repository commits
      • %commit% commit hash placeholder
      • eg https://github.com/qoomon/git-conventional-commits/commit/%commit%
      • if not set or empty link generation is disabled
    • issueUrl an URL template for generating markdown links to an issue tracker
      • %issue% issue id placeholder
      • eg https://jira.example.org/browse/%issue%
      • if not set or empty link generation is disabled

Automatically Validate Commit Message Convention before Commit

  • Setup Commit Message Hook to
    • Navigate to your repository directory cd <repository-path>
    • Create git hook directory mkdir .git-hooks
    • Set update hooksPath git config core.hooksPath .git-hooks
    • Create commit message hook script and make it executable
      • touch .git-hooks/commit-msg && chmod +x .git-hooks/commit-msg
      • Open .git-hooks/commit-msg with your favorite editor and paste following script
        #!/bin/sh
        
        # fix for windows systems
        PATH="/c/Program Files/nodejs:$HOME/AppData/Roaming/npm/:$PATH"
        
        git-conventional-commits commit-msg-hook "$1"
        
    • Add and commit .git-hooks/commit-msg to repository
    • ⚠️ Whenever you clone your repository with git hooks you need to enable git hooks once again
      • git config core.hooksPath .git-hooks

Release Workflow with git-conventional-commits

  1. Determine version by git-conventional-commits version
  2. Update version in project files
    • Commit version bump git commit -am'build(release): bump project version to <version>'
  3. Generate change log by git-conventional-commits changelog --release <version> --file 'CHANGELOG.md'
    • Commit change log git commit -am'doc(release): create <version> change log entry'
  4. Tag commit with version git tag -a -m'build(release): <version>' '<version-prefix><version>'
  5. Push all changes git push
  6. Build and upload artifacts

Build/Release

  • npm install
  • npm test
  • npm login
  • npm publish
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].