做(mkdir repo和cd repo之后)的区别是什么:
git init
git remote add origin git://github.com/cmcculloh/repo.git
git fetch --all
git pull origin master
and
git clone git://github.com/cmcculloh/repo.git
我的意思是,显然有一个更短,但除此之外,它们基本上是在做同样的事情吗?
做(mkdir repo和cd repo之后)的区别是什么:
git init
git remote add origin git://github.com/cmcculloh/repo.git
git fetch --all
git pull origin master
and
git clone git://github.com/cmcculloh/repo.git
我的意思是,显然有一个更短,但除此之外,它们基本上是在做同样的事情吗?
当前回答
克隆:将远程服务器存储库复制到本地机器。
Pull:获取其他已添加到本地机器的新更改。
这就是区别。
克隆通常用于获得远程回购副本。
Pull用于查看其他团队成员添加的代码,如果您在团队中工作。
其他回答
嗯,当我拉,当我克隆时,看到远程分支“4.2”时缺少什么?有些东西显然不一样。
tmp$ mkdir some_repo
tmp$ cd some_repo
some_repo$ git init
Initialized empty Git repository in /tmp/some_repo/.git/
some_repo$ git pull https://github.ourplace.net/babelfish/some_repo.git
:
From https://github.ourplace.net/babelfish/some_repo
* branch HEAD -> FETCH_HEAD
some_repo$ git branch
* master
vs
tmp$ rm -rf some_repo
tmp$ git clone https://github.ourplace.net/babelfish/some_repo.git
Cloning into 'some_repo'...
:
Checking connectivity... done.
tmp$ cd some_repo
some_repo$ git branch
* 4.2
完整的项目或存储库将作为一个单独的目录下载。不仅仅是变化 它只会获取已经完成的更改,而不是整个项目
用外行的话来说,我们可以说:
克隆:获取远程存储库的工作副本。 拉:我正在做这个,请给我其他人可能会更新的新变化。
克隆-:它将在您的本地机器上创建完全相同的远程存储库项目副本。
Pull-:假设两个或两个以上的人共享同一个存储库。 (假设另一个人叫Syam) (存储库是你的项目存在于Github的地方)所以如果Syam在他的本地的同一个项目中做了一些更改,并将其推到远程存储库,所以无论Syam做了什么更改,这些更改都不会反映在你的本地。因此,要在本地反映这些新变化,你必须使用git pull。总的来说,我们使用git pull来更新项目。
所以基本上我们只使用git clone一次,而我们使用git pull很多次。
Git克隆意味着您正在系统中创建存储库的副本。
git fork意味着你将存储库复制到你的Github帐户。
Git拉取意味着您正在获取最后修改的存储库。
Git push意味着您在修改存储库后返回它。
通俗来说:
Git克隆正在下载和Git拉刷新。