git代码同步操作

生产服务器代码提交推送:

[root@izbp18dv3a3metugyd02qxz syhuo.api]# git status -s
 M Api/Classes/MyMemcached.php
 M application/controllers/Merchants.php
 M application/controllers/Oauth2.php
 M application/controllers/Ota.php

[root@izbp18dv3a3metugyd02qxz syhuo.api]# git pull

[root@izbp18dv3a3metugyd02qxz syhuo.api]# git add .

[root@izbp18dv3a3metugyd02qxz syhuo.api]# git commit -am '接口添加访问日志记录'
[master 69a5bbc] 接口添加访问日志记录
 4 files changed, 330 insertions(+), 321 deletions(-)
[root@izbp18dv3a3metugyd02qxz syhuo.api]# git status -s
[root@izbp18dv3a3metugyd02qxz syhuo.api]#

[root@izbp18dv3a3metugyd02qxz syhuo.api]# git push origin master
Counting objects: 19, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 2.09 KiB | 0 bytes/s, done.
Total 10 (delta 8), reused 0 (delta 0)
remote: Resolving deltas: 100% (8/8)
remote: Updating references: 100% (1/1)
To http://liuchao:[email protected]:8062/r/syhuo.api.git
   4aa9dbf..69a5bbc  master -> master

本地机器拉取远程版本库代码:

git checkout . 放弃过去修改
git pull

猜你喜欢

转载自www.cnblogs.com/hnhycnlc888/p/12767780.html