This commit is contained in:
linlongchen
2020-07-22 12:26:26 +08:00
parent e375b2b17e
commit 58abbc5525
63 changed files with 212 additions and 103 deletions

View File

@@ -13,7 +13,7 @@ author: lemonchann
<!-- more --> <!-- more -->
## 安装Gitbook ## 安装Gitbook
* 安装nodejs可以去[官网](http://nodejs.cn/download/)下载对应版本 * 安装nodejs可以去[官网](http://nodejs.cn/download/)下载对应版本 Gitbook 只支持 node 6.x.x版本 。参考: https://www.jianshu.com/p/57b46db0564e
* 安装gitbook打开win cmd输入npm install gitbook-cli -g * 安装gitbook打开win cmd输入npm install gitbook-cli -g
> 常用命令: > 常用命令:
> **gitbook -V 查看版本** > **gitbook -V 查看版本**

Binary file not shown.

View File

@@ -0,0 +1,109 @@
标题别再把git当svn用了大厂程序员都是这样用git做版本管理的
## 版本控制
### 集中式
大家日常开发应该都有接触过版本控制,说起版本控制软件首先会想到老大哥`svn` 很多公司的老项目都会用svn来管理因为它是集中式的版本控制软件部署简单使用方便时svn的最大特点。我上家公司用的版本控制软件就是 `svn` ,包括鹅厂早起的项目也是基于 `svn` 做版本控制的,不过现在项目都是使用更加强大的 `git` 来做版本控制。
### 分布式
那么为什么需要版本控制呢?
## Git是什么
## 三种主流工作流
### Git flow
### Github flow
### Gitlab flow
## 实际操作
通用操作: git br -a 查看分支
开发分支操作:
// 1. 初始创建开发分支
git checkout -b dev/appeal_optimize_2 //创建并切换分支
git push -u origin dev/appeal_optimize_2 // 推送创建的分支到远端 (可选)
步骤2 可选
// 2.其他小伙伴下载代码后切换到开发分支
git clone
git checkout -b dev/appeal_optimize_2 origin/dev/appeal_optimize_2 // 创建本地开发分支并关联到远端分支
//3. 创建者已经在dev分支正常开发提交,推送到dev分支
git add file
git ci file -m 'msg'
git pull //拉取dev分支其他人的最新提交
git push // 推送到dev分支可选
// 4. 切换到master分支后把dev分支合并进来
git checkout master
git merge dev/appeal_optimize_2
//5. 开发完成删除dev分支必选包括本地和远程dev分支
git branch -d dev/appeal_optimize_2 // 删除本地分支
git push origin -d dev/appeal_optimize_2 或者 git push origin :dev/appeal_optimize_2 // 删除远程分支(可选)
出release版本流程操作 (非多人协作收集版本暂时可以不用这一步)
出release分支操作类似最后清除release分支
// 出完版本在master打tag做记录
git tag -a v2.0.0 -m "appeal optimize v2 region check and observe" master //本地
git push --tags 或者 git push origin v2.0.0 //远程
//版本出问题从master的tag处拉bugfix分支不影响其他开发分支
git checkout -b bugfix/appeal_optimize_2 v2.0.0
修改完合入master分支最后清除bugfix分支
## Reference
https://segmentfault.com/a/1190000016865867
https://iwiki.oa.tencent.com/pages/viewpage.action?pageId=103528756 主要参考 GitLab flow
http://km.oa.com/articles/show/349413?kmref=search&from_page=1&no=2 参考命令行 但是 他是Gitflow
http://km.oa.com/articles/show/429718?ts=1571801581 参考分支命名 但是他是Gitflow

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

BIN
images/公众号.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB