files.eol配置项含义:The default end of line character. Use \n for LF and \r\n for CRLF.
3、vscode安装插件,保存是自动转换成LF。比如EditorConfig for VS Code.
统一commit message格式
根据 angular 规范提交 commit, 这样 history 看起来更加清晰,还可以自动生成 changelog。
提交 commit 的类型,包括以下几种:
feat: 新功能
fix: 修复问题
docs: 修改文档
style: 修改代码格式(空格、换行、分号等),不影响代码逻辑
refactor: 重构代码(既不是修复bug,也不是增加新特性),理论上不影响现有功能
perf: 提升性能
test: 增加修改测试用例
chore: 修改工具相关(包括但不限于文档、代码生成等)
deps: 升级依赖,修改版本号
还可以借助插件来写符合规范的message:
1 2 3 4 5 6 7 8 9 10 11
# Making your repo Commitizen-friendly # For this example, we'll be setting up our repo to use AngularJS's commit message convention also known as conventional-changelog. # First, install the Commitizen cli tools: npm install commitizen -g
# Next, initialize your project to use the cz-conventional-changelog adapter by typing: commitizen init cz-conventional-changelog --save-dev --save-exact
# commit codes(use git cz to instead git commit) # For detailed explanation on how things work, checkout the [guide](https://github.com/commitizen/cz-cli). git cz
常用命令
基础操作
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# init git clone git@git.xxx.xx:xx/xxx.git
# add codes git add
# push codes git push origin feature-name
# new branch git checkout master git checkout -b feature-new
# merge branches(use rebase to instead merge) # For example, merge feature-new to master(please make master up-to-date with 'origin/master' at first) git checkout feature-new git rebase master git checkout master git rebase feature-new
tag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#新建标签 git tag v1.0 // 打在最近的commit上 git tag v0.9 f52c633 // 打在f52c633上 git tag -a v0.9 -m "blablabla..." // 指定标签信息
#查看标签 git tag // 查看所有标签 git show v0.9 // 查看单个标签,可以看到标签信息