Git(PART II)Clone,Pull,Push
2017-11-04 23:12
183 查看
问题描述
如果有一个新的人加入,他需要一个属于他自己的版本库的副本,命令
clone
创建克隆版本库
git clone path_original path_clone
创建裸版本
git clone --bare path_original path_clone
作用:充当开发者们传递提交(使用push命令)的汇聚点,以便他人可以从中拉回他们所做的修改。
效果图:
pull命令
没有参数,只在clone体中起作用
在workspace1中修改hello.txt,使得其中的内容为hello hello,原先为hello,之后提交在workspace1中打开git bash,执行pull命令,可以发现此时hello.txt的内容也变成了hello hello。
添加参数,可以把克隆体中的修改pull到原版中
此时在workspace1得hello.txt中也可以看到三个hello
push ,pull和裸版本库
可以使用push命令把修改提交到裸版本库再使用pull命令把修改取回
操作如下:
1:再次修改workspace1/hello.txt,使其内容为4个hello,使用push命令提交修改到裸版本库
2 :在workspace1_clone中pull,将刚刚的修改取回
此时可以看到,两个hello.txt文件的内容是一样的,里面都是4个hello。
相关文章推荐
- Git 远程操作 —— clone、push、pull、fetch
- Git的纯命令操作,Install,Clone , Commit,Push,Pull,版本回退,撤销更新,分支的创建/切换/更新/提交/合并,代码冲突
- git在windows下clone、pull或者push内存溢出的解决办法
- git clone,git push,git pull
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- git clone remote fetch pull push等操作
- Git的纯命令操作,Install,Clone , Commit,Push,Pull,版本回退,撤销更新,分支的创建/切换/更新/提交/合并,代码冲突
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并(转)
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- (转)Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- Git的pull、add、commit、push、clone
- git clone,push,pull,fetch
- git 浅析clone,remote,fetch,pull ,push
- Git操作指南(2) —— Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并(转)
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并