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