Differences between 'git pull' and 'git push'

In git's process, there are two ways to get the latest version of origin project.
One is use the 'git pull' command, 'git pull' helps us get the latest version from the origin repository, and then it automatically conducts the 'merge' command at the same time.

$ git pull origin master

Another command is 'git fetch', it is much safer than the former 'git pull'. It can also help us get the latest version from the origin repository, BUT it doesn't automatically conduct 'merge'. Before 'merge', we can see clearly the current status and then decide whether to merge or not.

$ git fetch origin master
$ git merge origin master
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Lesson 3: Using GitHub to Collaborate 3.1 Creating a GitH...
    赤乐君阅读 6,407评论 3赞 11
  • origin websiteComparing WorkflowsCentralized Workflow Fea...
    伍帆阅读 605评论 0赞 0
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 8,049评论 0赞 10
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 137,173评论 19赞 139
  • GitHub(持续更新中) 一、克隆项目到本地 1、在桌面上右击点git bash here 2、输入 git c...
    Eugenia海胆阅读 352评论 0赞 0

友情链接更多精彩内容