将平时学到的细碎的知识,整理到这里来
trylang / learning Goto Github PK
View Code? Open in Web Editor NEW将平时学到的细碎的知识,整理到这里来
将平时学到的细碎的知识,整理到这里来
以前只是简单的pull和push。从没有想过更多有关git的用法。随着对项目的认知加深,方才懂得项目的妥善管理同样重要。现将自己学到用到项目中的一些小技巧记录下来。
如果你还没有克隆现有仓库,并欲将你的仓库连接到某个远程服务器,你可以使用如下命令添加:
git remote add origin <server>
如此你就能够将你的改动推送到所添加的服务器上去了。
git checkout -b feature_x
;git checkout master
;git branch -d feature_x
;git push origin <branch>
;git pull
,以在你的工作目录中 获取(fetch) 并 合并(merge) 远端的改动。git merge <branch>
;git add <filename>
, 在合并改动之前,也可以使用如下命令查看:git diff <source_branch> <target_branch>
.git tag 1.0.0 1b2e1d63f
,1b2e1d63ff 是你想要标记的提交 ID 的前 10 位字符。使用如下命令获取提交 ID:git log
,你也可以用该提交 ID 的少一些的前几位,只要它是唯一的。git tag
or git show v1.0
;git tag v1.0
;git tag -a v1.0 -m'my version 1.0'
;git log
中获取commit id。再最后一个参数写入commit id。git tag -a v1.0 9fceb03
。git tag -d tempTag
or git tag --delete tempTag
。git push origin [tagname]
.
git push origin v1.2
;git push origin --tags
。为了提高代码质量,提高产品的稳定性,启用代码review框架,请每一位代码提交者控制代码质量,进行功能测试,每一位审核者检查代码逻辑。 该框架依赖gitlab的merge request功能,之后所有提交全部需要review,且工作流有一定的变化,默认情况下所有分支为保护分支,不允许git push操作,需要如下操作用以提交代码。
分支状态说明:
Develop:开发分支,代码开发使用
Release:发布版分支,develo经过代码测试后会合并到该分支,release分支作为客户,公有云发布的主分支
Master:暂无用途
工作流程:
克隆develop分支(该项目可用作测试)
创建自己的研发分支,也可以是功能分支,bug分支,等,并提交到远端
在当前jia分支上进行功能开发,流程正常,add/commit 等,过程中需要使用git pull origin develop 来同步develop分支中其他提交
开发完成后,登陆网页,创建该分支到develop的merege request,选择review owner,需要详细的提交日志,bug号,改动原因等信息
cid:[email protected]
cid:[email protected]
Reviewer 登陆网页后会在Merge Requests里看到需要merge和review的代码,可以写评论,关闭/接受分支,接受后,分支会自动合并,如果有冲突,需要人工解决。
PS:开发过程中,请尽量多执行git pull origin develop用以同步远程分支,也可以使用fetch。同时每个功能的merge尽量控制,否则太多可能导致review复杂。不允许任何提交日志中无bug/task/feature编号
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.