美文网首页
Git命令 切换分支

Git命令 切换分支

作者: 狂奔的大蜗牛 | 来源:发表于2018-08-20 19:31 被阅读0次

1、查看远程分支
项目根目录下执行以下命令:

xiaoqi:dev xq$ git branch -a
* feature-hr
  remotes/origin/HEAD -> origin/master
  remotes/origin/feature-finance
  remotes/origin/feature-hr
  remotes/origin/master

2、查看本地分支

xiaoqi:dev xq$ git branch
* feature-hr

3、切换分支

xiaoqi:dev xq$ git checkout -b feature-finance origin/feature-finance
Branch feature-finance set up to track remote branch feature-finance from origin.
Switched to a new branch 'feature-finance'
xiaoqi:dev xq$

切换后的本地分支

xiaoqi:dev xq$ git branch
* feature-finance
  feature-hr

4、切回master分支

xiaoqi:dev xq$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

相关文章

  • git分支的创建与使用

    在此记录下命令: 创建命令:git branch 分支名 切换分支:git checkout 分支名 创建并切换分...

  • Git命令

    分支相关命令 切换分支git checkout <分支名称> 新建并切换到新分支git checkout -b <...

  • Git 6 分支管理

    创建分支命令: git branch (branchname) 切换分支命令 git checkout (bran...

  • 常用的Git命令

    Git命令 克隆代码:git clone 创建分支:git branch branchname 切换分支:git ...

  • Git 命令笔记

    Git 命令: 分支 查看当前分支: git branch查看远程分支: git branch -a切换分支: g...

  • GIT常用命令

    分支相关命令查看分支:git branch 创建分支:git branch 切换分支:git che...

  • git操作-常用命令

    git常用命令 查看分支 git branch 创建分支 git branch 切换分支 git ...

  • git常用命令行

    基础git命令 查看分支:git branch创建分支:git branch name切换分支:git check...

  • 修改git名称和邮箱

    进入C盘找到 .gitconfig文件打开命名窗口 命令如下: git分支切换 git提交切换 git分支比对

  • Git 快速使用 之 Git 分支 branch

    查看分支 git 命令: $ git branch -a 说明:查看所有分支 * 代表当前处在的分支, 切换分支 ...

网友评论

      本文标题:Git命令 切换分支

      本文链接:https://www.haomeiwen.com/subject/retriftx.html