commit
f768f361c1
|
@ -0,0 +1,119 @@
|
|||
### 开发流程
|
||||
|
||||
|
||||
|
||||
- 拉取 master 到本地
|
||||
|
||||
```
|
||||
git fetch origin master && git rebase origin/master
|
||||
```
|
||||
|
||||
- 查看本地更改 commit
|
||||
```
|
||||
git log
|
||||
```
|
||||
|
||||
- 添加分支
|
||||
|
||||
```sh
|
||||
# name-(feat, fix, doc)-(mode)-(task)
|
||||
git checkout -b doc-pro-git-doc
|
||||
```
|
||||
|
||||
- do task
|
||||
|
||||
- 提交 检查
|
||||
|
||||
```
|
||||
git push origin doc-pro-git-doc
|
||||
```
|
||||
|
||||
- 监听文件
|
||||
|
||||
```
|
||||
git add .
|
||||
```
|
||||
|
||||
- 添加 commit
|
||||
|
||||
```
|
||||
git commit -m "init doc"
|
||||
```
|
||||
|
||||
>**commit message格式**
|
||||
>
|
||||
>```text
|
||||
><type>(<scope>): <subject>
|
||||
>```
|
||||
>
|
||||
>**type(必须)**
|
||||
>
|
||||
>用于说明git commit的类别,只允许使用下面的标识。
|
||||
>
|
||||
>feat:新功能(feature)。
|
||||
>
|
||||
>fix:修复bug,可以是QA发现的BUG,也可以是研发自己发现的BUG。
|
||||
>
|
||||
>doc:文档(documentation)。
|
||||
>
|
||||
>style:格式(不影响代码运行的变动)。
|
||||
>
|
||||
>refactor:重构(即不是新增功能,也不是修改bug的代码变动)。
|
||||
>
|
||||
>perf:优化相关,比如提升性能、体验。
|
||||
>
|
||||
>test:增加测试。
|
||||
>
|
||||
>chore:构建过程或辅助工具的变动。
|
||||
>
|
||||
>revert:回滚到上一个版本。
|
||||
>
|
||||
>merge:代码合并。
|
||||
|
||||
|
||||
|
||||
- 提交PR (remove)
|
||||
|
||||
```
|
||||
添加描述, 提交PR
|
||||
```
|
||||
|
||||
- 解决问题
|
||||
|
||||
- 整理 commit
|
||||
|
||||
- 整理
|
||||
|
||||
```shell
|
||||
git rebase -i origin/master
|
||||
f:
|
||||
# 回调
|
||||
git rebase --abort
|
||||
|
||||
# 继续
|
||||
|
||||
```
|
||||
|
||||
- 强行推送
|
||||
|
||||
```
|
||||
git push -f origin doc-pro-git-doc
|
||||
```
|
||||
|
||||
- 重做
|
||||
|
||||
```sh
|
||||
git log
|
||||
# 7e8108bc7347ef6e2f01d6bc1d1f249afc82a486
|
||||
|
||||
git reset 7e8108bc7347ef6e2f01d6bc1d1f249afc82a486
|
||||
```
|
||||
|
||||
- 合并冲突
|
||||
|
||||
```sh
|
||||
# B 分支名称
|
||||
git pull origin B
|
||||
```
|
||||
|
||||
-
|
Loading…
Reference in New Issue