码迷,mamicode.com
首页 > 其他好文 > 详细

git和github -3 同步到远程仓库

时间:2015-09-05 17:41:02      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:

Git命令

  git remote — 查看远程仓库的名字

     -v — 查看远程仓库对应的地址

     -origin — 远程仓库的名字

  git push 仓库名(默认是origin) 分支(master) — 同步到远程仓库  

  默认:git push origin master

  

  添加新的协作人员

    1. 点+New collaborator,然后Add collaborator

 

  同步更新代码 && 多人协作解决冲突

  git fetch — 从远程拉取数据进行对比,需要手动合并(建议)

     git diff master origin/master — 对比区别(红色表示本地,绿色表示远端)

     git merge origin/master — 手动合并(要去相关文件查看)

  技术分享

  git pull — 从远端拉取自动合并(远端同步到本地分支)

 

  补:切换账号

  git config --global user.name "pingguosky"  设置全局用户名

  git config --global user.email "694195417@qq.com"  设置全局邮箱

  客户端需重新切换

 

git和github -3 同步到远程仓库

标签:

原文地址:http://www.cnblogs.com/zouxinping/p/4783500.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!