git基本使用方法

本文详细介绍了如何使用Git进行ZTE SSWK项目的下载、提交及常用命令。包括通过特定URL克隆项目、提交代码变更并选择审批人等流程。

1、下载:
1).单击:clone with commit-msg hook
2).单击:ssh
3).复制URL:git clone ssh://6176000047@gerrit.zte.com.cn:29418/vmax/vmax-r/vmax-r-thirdparty-sswk && scp -p -P 29418 6176000047@gerrit.zte.com.cn:hooks/commit-msg vmax-r-thirdparty-sswk/.git/hooks/
开始下载
{ 第一步:浏览器进入http://gerrit.zte.com.cn/#/admin/projects/
第二步:filter筛选sswk工程
第三步:选择表头的'ssh'、'clone with commit-msg hook' 然后复制
第四步:将复制的内容git clone ssh://6176000047@gerrit.zte.com.cn:29418/vmax/vmax-r/vmax-r-thirdparty-sswk && scp -p -P 29418 6176000047@gerrit.zte.com.cn:hooks/commit-msg vmax-r-thirdparty-sswk/.git/hooks/
第五步:打开git bash ,将第四步的内容复制在命令行 ,开始下载
}
2、提交;
1).git add ./ -----第一步添加到待提交的模板
2).git commit -m "sswk工程合入最新代码" ----第二步写日志
3).git push origin HEAD:refs/for/master -----第三步提交到服务器
4).open "http://gerrit.zte.com.cn/#/dashboard/self"->My->Changes(选择审批人) ---第四步选择审批人,审批通过才能合入版本
3、git常用命令
git pull 更新当前目录
git branch -a 查看分支情况
git branch 查看当前所在的分支
git checkout remotes/origin/branch/V6.17.10.40.01B3 切换分支,切换到B3分支上
git提交;
1).git add ./ -----第一步添加到待提交的模板
2).git commit -m "sswk工程合入最新代码" ----第二步写日志
3).git push origin HEAD:refs/for/master -----第三步提交到服务器
4).open "http://gerrit.zte.com.cn/#/dashboard/self"->My->Changes(选择审批人) ---第四步选择审批人,审批通过才能合入版本

转载于:https://www.cnblogs.com/hymmiaomiao/p/8692297.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值