项目git分支版本常用命令

1:从git取代码

[root@iZ947b5bf0rZ noahgate]#git clone git@git.bosyun.com:wangjun/noahgate.git

 

2:查看本地代码修改状态

[root@iZ947b5bf0rZ noahgate]# git status

 

3: 将本地不需要提交的文件用GIT服务器最新版本覆盖掉

[root@iZ947b5bf0rZ noahgate]# git checkout src/providers/constants.ts

 

4.添加提交代码文件(.为所有文件)

[root@iZ947b5bf0rZ noahgate]# git add .

 

5.添加提交注释

[root@iZ947b5bf0rZ noahgate]# git commit -m "XXXXX"

 

6: 提交代码(add,commit和以前一样),将服务器最新代码拉到本地合并

[root@iZ947b5bf0rZ noahgate]#git pull origin master;

 

7.如有代码版本冲突,解决冲突,合完代码后再从重执行4,5步

 

8: 提交代码到GIT服务器

[root@iZ947b5bf0rZ noahgate]#git push origin master;

 

 

 

将服务器各版本更新到本地,否则无法执行(git checkout xx)切换分支

[root@iZ947b5bf0rZ noahgate]# git fetch

 

查看当前分类版本

[root@iZ947b5bf0rZ noahgate]# git branch

  led

* master

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值