你的位置:首页 > 软件开发 > ASP.net > Git学习笔记(7)——多人协作

Git学习笔记(7)——多人协作

发布时间:2015-05-15 16:00:24
本文主要记录了,多人协作时,产生冲突时的解决情况.多人环境创建首先我们需要模拟一个多人环境。前面的Git的学习都是在Ubuntu上面,现在我们也搭建一个win环境吧。安装win环境下的Git,很简单,github.com官网下载,就像QQ一样,安装完以后,开始&mdash ...

本文主要记录了,多人协作时,产生冲突时的解决情况.


多人环境创建

首先我们需要模拟一个多人环境。前面的Git的学习都是在Ubuntu上面,现在我们也搭建一个get='_blank'>win环境吧。安装win环境下的Git,很简单,github.com官网下载,就像QQ一样,安装完以后,开始——所有程序——GitHub,Inc文件夹下的Git Shell打开即可。前面的Git命令在这里都可以的。ls你就会发现.ssh文件了,而且你登陆web的Git后,在Settings的SSH key里,已经自动添加了win的公钥。我们所做的就是

  1. 为主机设置邮箱和用户名
  2. 建立SSH连接
  3. 克隆远端的库
Windows PowerShellCopyright (C) 2009 Microsoft Corporation. All rights reserved.C:\Users\joe> ls  Directory: C:\Users\joeMode        LastWriteTime   Length Name----        -------------   ------ ----....d----     5/10/2015  9:13 PM      .ssh  //这里我只显示了2个有关的文件-a---     5/10/2015  9:13 PM    145 .gitconfig...C:\Users\joe> 
git remote
  //查看连接,发现没有连接fatal: Not a git repository (or any of the parent directories): .gitC:\Users\joe> 
mkdir work
  //连接工作目录,并git init  Directory: C:\Users\joeMode        LastWriteTime   Length Name----        -------------   ------ ----d----     5/12/2015  9:36 AM      workC:\Users\joe> cd .\workC:\Users\joe\work> git initInitialized empty Git repository in C:/Users/joe/work/.git/C:\Users\joe\work [master]> git remote//下面的应该换成你自己的git文件C:\Users\joe\work [master]> 
git remote add origin git@github.com:joesGit15/
learngit.gitC:\Users\joe\work [master]> 
git remote -v
  //已经有了连接origin git@github.com:joesGit15/learngit.git (fetch)origin git@github.com:joesGit15/learngit.git (push)//可以看到已经有了连接,然后设置邮箱和用户名C:\Users\joe\work [master]> 
git config --
global user.email little_star14@sina.cnC:\Users\joe\work [master]> 
git config --global user.name "joe-PC"
C:\Users\joe\work [master]> 
git clone git@github.com:joesGit15/learngit.git
//克隆自己的库Cloning into 'learngit'...Warning: Permanently added 'github.com,192.30.252.130' (RSA) to the list of known hosts.remote: Counting objects: 60, done.remote: Compressing objects: 100% (34/34), done.remote: Total 60 (delta 13), reused 59 (delta 12), pack-reused 0Receiving objects: 100% (60/60), 4.87 KiB | 0 bytes/s, done.Resolving deltas: 100% (13/13), done.Checking connectivity... done.C:\Users\joe\work [master +1 ~0 -0 !]> ls//查看,成功  Directory: C:\Users\joe\workMode        LastWriteTime   Length Name----        -------------   ------ ----d----     5/12/2015  9:48 AM      learngitC:\Users\joe\work [master +1 ~0 -0 !]> cd .\learngitC:\Users\joe\work\learngit [master]>
ls
  Directory: C:\Users\joe\work\learngitMode        LastWriteTime   Length Name----        -------------   ------ -----a---     5/12/2015  9:48 AM     11 abc.c-a---     5/12/2015  9:48 AM    164 readme.txtC:\Users\joe\work\learngit [master]>

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:Git学习笔记(7)——多人协作

关键词:Git

Git
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。