git中的pull和clone有什么区别? [英] What is the difference between pull and clone in git?
问题描述
执行操作(在 mkdir repo
和 cd repo
之后)有什么区别:
git init
git remote add origin git://github.com/cmcculloh/repo.git
git fetch --all
git pull origin master
和
git clone git://github.com/cmcculloh/repo.git
我的意思是,显然有一个更短,但除此之外,他们基本上是做同样的事情?
>它们基本上是一样的,除了克隆将设置额外的远程跟踪分支,而不仅仅是主控。查看手册页:
< blockquote>
将存储库克隆到新创建的目录中,为克隆存储库中的每个分支创建远程跟踪分支(使用git branch -r可见),并创建并签出分叉的初始分支来自克隆存储库当前活动的分支。
What is the difference between doing (after mkdir repo
and 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
I mean, obviously one is shorter, but other than that are they basically doing the same thing?
They're basically the same, except clone will setup additional remote tracking branches, not just master. Check out the man page:
Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository (visible using git branch -r), and creates and checks out an initial branch that is forked from the cloned repository's currently active branch.
这篇关于git中的pull和clone有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!