• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

fteem/git-semantic-commits: Tiny semantic commit messages for Git.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

fteem/git-semantic-commits

开源软件地址:

https://github.com/fteem/git-semantic-commits

开源编程语言:

Shell 100.0%

开源软件介绍:

Semantic Git commit messages

Inspired by Sparkbox's awesome article on semantic commit messages.

What is this?

These are very simple custom git commands that enforce the git user to write better git commit messages. If still confused, read the article above.

Installation:

  1. Clone this repo, preferably in your $HOME directory.
git clone https://github.com/fteem/git-semantic-commits ~/.git-semantic-commits

Tip: If you're using Cygwin, open it and type echo $USERPROFILE. This will show you the location of the $HOME directory.

  1. Install it as a set of bash scripts or git aliases:
  • bash scripts
cd ~/.git-semantic-commits && ./install.sh --scripts
  • git aliases
cd ~/.git-semantic-commits && ./install.sh

Tip: Installation script is idempotent and could be harmlessly executed multiple times. It adds bash scripts to the PATH in your ~/.bashrc or ~/.zshrc files or adds git aliases to the ~/.gitconfig file respectively (without any duplication).

  1. Commit away!

Usage

There are 8 new Git commands now.

New command -> what it does:

  • git feat "commit message here" -> git commit -m 'feat: commit message here'
  • git docs "commit message here" -> git commit -m 'docs: commit message here'
  • git chore "commit message here" -> git commit -m 'chore: commit message here'
  • git fix "commit message here" -> git commit -m 'fix: commit message here'
  • git refactor "commit message here" -> git commit -m 'refactor: commit message here'
  • git style "commit message here" -> git commit -m 'style: commit message here'
  • git test "commit message here" -> git commit -m 'test: commit message here'
  • git localize "commit message here" -> git commit -m 'localize: commit message here'

If you would like to add an optional scope, as described here, use the '-s' flag and quote the scope message:

  • git docs -s "scope here" "commit message here" -> git commit -m 'docs(scope here): commit message here'

If you would still like to use your text editor for your commit messages you can omit the message, and do your commit message in your editor.

  • git feat -> git commit -m 'feat: ' -e

Aliases for those who use git-extras (will be installed only if you have git-extras):

  • git rf "commit message here" -> git commit -m 'refactor: commit message here'
  • git ch "commit message here" -> git commit -m 'chore: commit message here'

Uninstallation

You can manually uninstall git-semantic-commits by:

  • Removing the added aliases from ~/.gitconfig.
  • Removing the line added to the $PATH variable from ~/.bashrc.

How to contribute

Open a pull request/issue or fork this repo and submit your changes via a pull request.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
littleark/githut: Visualization of data from github archive.发布时间:2022-06-11
下一篇:
hvr/trac-git-plugin: Git Plugin for Trac发布时间:2022-06-11
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap