sichenguo / demo Goto Github PK
View Code? Open in Web Editor NEWSome small demo
Some small demo
master
分支命名: feature/ 开头的为特性分支,命名规则为 feature/xxx。举例来讲,如 xxx10 月 18 日要开发一个通讯录改进的功能,可以自建分支为 feature/contacts_advance-ty-1018。
一般 fork 自 develop 分支,最终可能会合并到 develop 分支。
一般 feature 分支应仅包含一个特性,上线(合并至 master)部署验证无误后即可删除。记得及时将 feature 分支 push 至远端。
如果合并至 develop 或 master 时发现在 fork 此特性分支之后分支已合并了很多其它分支的提交,请先执行 git rebase,这样能提交历史更加整洁。
创建一个功能分支:
git checkout -b feature/x dev
开发完成后,将功能分支合并到 dev 分支:
git checkout dev
git merge –no-ff feature/x
第二种是预发布分支,它是指发布正式版本之前(即合并到 Master 分支之前),我们可能需要有一个预发布的版本进行测试。预发布分支是从 Dev 分支上面分出来的,预发布结束以后,必须合并进 Dev 和 Master 分支。
分支命名: release/ 开头的为预发布分支,命名规则为 release/(date/versionNumber) (前端版本号:主版本号. 子版本号. 修正版本号)
上线后即可删除。
创建一个预发布分支:
git checkout -b release/v_1.2 dev
确认没有问题后,合并到 master 分支:
git checkout master
git merge –no-ff release/v_1.2
对合并生成的新节点,做一个标签: git tag -a v_1.2
再合并到 dev 分支:
git checkout dev
git merge –no-ff release/v_1.2
最后,删除预发布分支: git branch -d release/v_1.2
分支命名: hotfix/ 开头的为修复分支,它的命名规则与 feature 分支类似。
一般我们如果发现紧急线上 bug,可以将线上代码临时回滚,从最新的 master 分支建立 hotfix 分支,提交修复代码、测试无误后,合并至 develop 和 master。
上线验证无误后,即可将 hotfix 分支删除。
创建一个修补 bug 分支:
git checkout -b hotfix/0.1 master
修补结束后,合并到 master 分支
git checkout master
git merge –no-ff hotfix/0.1
git tag -a 0.1.1
合并到 dev 分支
git checkout dev
git merge –no-ff hotfix/0.1
最后,删除” 修补 bug 分支”:git branch -d hotfix/0.1
添加
git tag -a V_0.1.1.0 -m"基本部署完成,有 BUG 待做"
删除 git tag -d V_0.1.1.0
推送到远程
git push origin V_0.1.1.0
git push –tags
最后一种是修补 bug 分支。软件正式发布以后,难免会出现 bug。这时就需要创建一个分支,进行 bug 修补。
修补 bug 分支是从 Master 分支上面分出来的。修补结束以后,再合并进 Master 和 Dev 分支。它的命名,可以采用 fixbug/xxx 的形式。
创建一个修补 bug 分支:
git checkout -b fixbug/20180926 master
git push --set-upstream origin fixbug/20180926
修补结束后,合并到 master 分支:
git checkout master
git merge –no-ff fixbug/20180926
git tag -a xxx
再合并到 dev 分支:
git checkout dev
git merge –no-ff fixbug/20180926
最后,删除” 修补 bug 分支”:
git branch -d fixbug-0.1
###命名分支必须遵守一些简单的规则
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.