文章

Git commit 规范

Git

Git init

设置安全目录

git config --global --add safe.directory /mnt/hgfs/code/php_ws/rxtant

设置全局git 用户名,邮箱

git config --global user.name "username"
git config --global user.email "you@email.com"

生成SSH密钥
ssh-keygen -t rsa -b 4096 -C "youemail@ex.com"

统计非 vendor目录的代码总行数
git ls-tree -r HEAD --name-only | grep -vE '(^|/)vendor/' | xargs -I {} git blame -w {} | wc -l

Git log

commit message格式

<type>(<scope>): <description>
// 空行
<body>

type: 提交的类型

	feat: 新功能(feature)

	fix: 修补 bug

	docs: 文档(documentation)

	style: 格式(不影响代码运行的变动)

	refactor: 重构(即不是新增功能,也不是修改 bug 的代码变动)

	test: 增加测试

	chore: 构建过程或辅助工具的变动

	upgrade: 升级改造

	optimize:优化

	perf:提升性能

	scope(可选): 变动影响的范围

	description: 简明描述

	body(可选): 详细描述
License:  CC BY 4.0