What is the difference between pull and clone in git?

后端 未结 11 1610
太阳男子
太阳男子 2020-12-04 04:29

What is the difference between doing (after mkdir repo and cd repo):

git init
git remote add origin git://github.com/cmcculloh/repo         


        
11条回答
  •  心在旅途
    2020-12-04 04:59

    While the git fetch command will fetch down all the changes on the server that you don’t have yet, it will not modify your working directory at all. It will simply get the data for you and let you merge it yourself. However, there is a command called git pull which is essentially a git fetch immediately followed by a git merge in most cases.

    Read more: https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches#Pulling

提交回复
热议问题