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

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"  设置全局邮箱

  客户端需重新切换

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