zoukankan      html  css  js  c++  java
  • git从已有分支拉新分支开发

    开发过程中经常用到从master分支copy一个开发分支,下面我们就用命令行完成这个操作:

    1. 切换到被copy的分支(master),并且从远端拉取最新版本

    $git checkout master

    $git pull

    2. 从当前分支拉copy开发分支

    $git checkout -b dev

    Switched to a new branch 'dev'

    3. 把新建的分支push到远端
    $git push origin dev

    4. 拉取远端分支
    $git pull

    There is no tracking information for the current branch.
    Please specify which branch you want to merge with.
    See git-pull(1) for details.

    git pull <remote> <branch>

    If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> dev

    经过验证,当前的分支并没有和本地分支关联,根据提示进行下一步:
    5. 关联

    $git branch --set-upstream-to=origin/dev
    6. 再次拉取 验证

    $git pull

    转载于:https://www.cnblogs.com/beixiaoyi/p/9894388.html

  • 相关阅读:
    列表、元组、字典等相关命令
    字符串相关命令
    Python简介
    二进制的趣事
    Shell脚本基础
    Linux基本服务
    一次性计划任务at与周期性计划任务crontab
    Linux权限管理
    python-文件操作
    python-初识python
  • 原文地址:https://www.cnblogs.com/it-deepinmind/p/11805540.html
Copyright © 2011-2022 走看看