Skip to content

Commit e4fe99a

Browse files
committed
update
1 parent 6b4d0dc commit e4fe99a

File tree

1 file changed

+77
-53
lines changed

1 file changed

+77
-53
lines changed

public/README.md

Lines changed: 77 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179

180180
> 引自`Airbnb JavaScript Style`
181181

182-
182+
183183
[Airbnb JavaScript Style Guide 中文](https://github.com/yuche/javascript/blob/master/README.md)
184184

185185
[Airbnb JavaScript Style Guide 英文原版](https://github.com/airbnb/javascript/blob/master/README.md)
@@ -2119,81 +2119,100 @@
21192119
> 多人协作,为保证开发效率及新功能代码管理,
21202120
> 采用按功能`新建分支开发`的方式
21212121

2122-
- **新建:** 在稳定、干净的develop分支创建新分支
2123-
2124-
```
2125-
git checkout -b newBranchName
2126-
```
2127-
2128-
新分支命名:
2122+
`遵循Gitflow工作流`
21292123

2130-
> newBranchName = 主分支-开发人员-功能(需求)概述
2124+
- 功能分支
21312125

2132-
- **开发:** 在newBranchName分支进行开发
2126+
每个新功能位于一个自己的分支,这样可以push到中央仓库以备份和协作。但功能分支不是从`master`分支上拉出新分支,而是使用`develop`分支作为父分支。当新功能完成时,合并回`develop`分支。新功能提交应该从不直接与`master`分支交互。
21332127

2134-
add:
2128+
**操作步骤**
21352129

2136-
```js
2137-
// 添加所有修改的文件
2138-
git add .
2130+
- **新建:** 在稳定、干净的develop分支创建新分支
21392131

2140-
// or 单文件添加
2141-
git add path/to/your/fileName
2142-
```
2132+
```
2133+
git checkout -b newBranchName
2134+
```
21432135

2144-
commit:
2145-
```
2146-
git commit -m "write your commit message here"
2147-
```
2136+
新分支命名:
21482137

2149-
push:
2150-
```
2151-
git push remote HEAD:newBranchName
2152-
```
2138+
> newBranchName = 主分支-开发人员-功能(需求)概述
21532139

2154-
- **合并** newBranchName分支开发的功能合并到develop分支
2140+
- **开发** 在newBranchName分支进行开发
21552141

2156-
- 首先:切换到develop分支,并更新develop分支代码,确保其是最新代码
2142+
add:
21572143

21582144
```js
2159-
// 1 - 切换分支
2160-
git checkout develop
2145+
// 添加所有修改的文件
2146+
git add .
21612147
2162-
// 2 - 更新仓库代码
2163-
git pull remote develop
2148+
// or 单文件添加
2149+
git add path/to/your/fileName
21642150
```
21652151

2166-
- 第二步:合并newBranchName分支到develop分支
2152+
commit:
2153+
```
2154+
git commit -m "write your commit message here"
2155+
```
21672156

2168-
```js
2169-
// 确保当前是在develop分支
2170-
git merge remote/newBranchName
2157+
push:
2158+
```
2159+
git push remote HEAD:newBranchName
21712160
```
21722161

2173-
- 第三步:提交合并结果至远程develop仓库
2162+
- **合并:** newBranchName分支开发的功能合并到develop分支
21742163

2175-
> 此处若有conflict提示,可以先处理完冲突,然后依次执行`add` -> `commit` 操作
2164+
- 首先:切换到develop分支,并更新develop分支代码,确保其是最新代码
21762165

2177-
**提交**push(提交合并+解决conflict产生的所有更新):
2166+
```js
2167+
// 1 - 切换分支
2168+
git checkout develop
21782169
2179-
```
2180-
git push remote HEAD:develop
2181-
```
2170+
// 2 - 更新仓库代码
2171+
git pull remote develop
2172+
```
21822173

2183-
- **删除:** 开发完成,删除新增的分支
2174+
- 第二步:合并newBranchName分支到develop分支
21842175

2185-
- 删除远程newBranchName分支
2186-
```
2187-
git push remote :newBranchName
2188-
```
2176+
```js
2177+
// 确保当前是在develop分支
2178+
git merge remote/newBranchName
2179+
```
21892180

2190-
- 删除本地newBranchName分支
2191-
```
2192-
git branch -D newBranchName
2193-
```
2194-
> remote 为远程主机名,一般为 origin
2181+
- 第三步:提交合并结果至远程develop仓库
2182+
2183+
> 此处若有conflict提示,可以先处理完冲突,然后依次执行`add` -> `commit` 操作
2184+
2185+
**提交**push(提交合并+解决conflict产生的所有更新):
2186+
2187+
```
2188+
git push remote HEAD:develop
2189+
```
2190+
2191+
- **删除:** 开发完成,删除新增的分支
2192+
2193+
- 删除远程newBranchName分支
2194+
```
2195+
git push remote :newBranchName
2196+
```
2197+
2198+
- 删除本地newBranchName分支
2199+
```js
2200+
git branch -d newBranchName
21952201
2196-
[Git Documentation](https://git-scm.com/book/zh/v1/)
2202+
// 强制删除 - 将会丢失未合并的修改
2203+
git branch -d newBranchName
2204+
```
2205+
**Gitflow流程图示**
2206+
2207+
![Gitflow](https://raw.githubusercontent.com/arslanbilal/git-cheat-sheet/master/Img/git-flow-commands-without-flow.png)
2208+
2209+
**参考资料:**
2210+
2211+
[Git Documentation](https://git-scm.com/book/zh/v1/)
2212+
2213+
[Git Cheat Sheet 中文版](https://github.com/arslanbilal/git-cheat-sheet/blob/master/other-sheets/git-cheat-sheet-zh.md)
2214+
2215+
[Git工作流指南:Gitflow工作流](http://blog.jobbole.com/76867/)
21972216

21982217

21992218
**[⬆ 返回目录](#table-of-contents)**
@@ -2237,7 +2256,12 @@
22372256
- 使用事件委托,避免过多的DOM元素的事件绑定;
22382257
- 善用浏览器`Performance`工具;
22392258

2240-
> [Vue 风格指南](https://cn.vuejs.org/v2/style-guide/)
2259+
2260+
2261+
2262+
[Tinypng](https://tinypng.com/)
2263+
2264+
[Vue 风格指南](https://cn.vuejs.org/v2/style-guide/)
22412265

22422266

22432267
**[⬆ 返回目录](#table-of-contents)**

0 commit comments

Comments
 (0)