• 拉取远程分支到本地


    情况一:目前本地还没拉代码,直接拉分支代码

    git clone -b ac git@gitlab.yopoint.vip:ac/YoPointSwift.git

    情况二:本地已经拉取了代码,想拉取远程某一分支的代码到本地

    git checkout -b ac_branch origin/ac_branch   拉取远程分支到本地(方式一)

    git fetch origin ac_branch:ac_branch  拉取远程分支到本地(方式二)

    ************************************************************

    扩展一:

    方式一有可能出现错误提示:

    fatal: 'origin/ac_branch' is not a commit and a branch 'ac_branch' cannot be created from it

    解决方式:

    执行命令:git fetch    同步一下仓库

    扩展二:新手最容易出错的操作

    git checkout -b ac_branch        这是在当前分支上创建一个ac_branch分支

    git checkout -b ac_branch origin/ac_branch   这才是拉取远程分支ac_branch到本地

    扩展三:方式一、二的区别

    方式一做了三件事:

    1、拉取远程分支到本地

    2、在本地创建一个分支与远程分支对应

    3、自动切换到刚创建好的分支

    方式二做了三件事:

    1、同步远程仓库(git fetch origin)

    2、拉取远程分支到本地

    3、在本地创建一个分支与远程分支对应



  • 相关阅读:
    Expression多条件筛选
    Express对条件的手动拼接
    查看绝对路径
    检查Linux内核版本信息
    New 路程 2019
    Braintree PayPal 支付网关开发(二)
    Braintree PayPal 支付网关开发(一)
    Quartz 作业调度框架的使用
    C# 扩展方法
    ASP.Net MVC管道分析
  • 原文地址:https://www.cnblogs.com/lidabo/p/15525033.html
Copyright © 2020-2023  润新知