git clone vs复制粘贴,有什么区别? [英] git clone vs copy paste, what's the difference?

查看:705
本文介绍了git clone vs复制粘贴,有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:git克隆我的意思是没有任何选项的git克隆,这是通过执行git clone / C :/ my_origin_folder

解决方案

我的这个关于备份的答案应该会给你一些克隆与复制的答案:将git repo移动到第二台计算机?



主要差异:


  1. 当您克隆时,您会获得远程来源
  2. 你克隆,但是当你复制的时候你会这样做

请注意,当你使用文件夹路径克隆时,差异会微妙地变化, refs通常只是复制/硬连接(相当于 - local ,这是默认的w ith本地文件夹路径)


as stated in the subject

note: the git clone i mean is the git clone without any option, the one which is performed by doing "git clone /C:/my_origin_folder"

解决方案

This answer of mine regarding backup should give you some answer on clone vs copy: Moving a git repo to a second computer?

Main differences:

  1. When you clone, you get remote origin setup pointing to original repo, so that you can push to it.
  2. You don't get hooks and reflog ( and also old objects) and other remotes when you clone but you do when you copy

Note that when you clone with a folder path, the differences change subtly, as the objects and refs are usually just copied / hardlinked ( equivalent of --local which is the default with local folder paths)

这篇关于git clone vs复制粘贴,有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆