git命令切换分支

作者: 强强刘 | 来源:发表于2019-04-15 16:34 被阅读2次

Git一般有很多分支,我们clone到本地的时候一般都是master分支.

1. 查看本地及远程分支
$ git branch -a 
我在mxnet根目录下运行以上命令:
$ git branch -a
* English
  master
  remotes/origin/English
  remotes/origin/document
  remotes/origin/master

很明显当前我们在master分支

2. 查看本地分支
$ git branch
* English
  master
  remotes/origin/English
  remotes/origin/master
2. 查看远程分支
$ git branch -r
* English
  master
  remotes/origin/English
  remotes/origin/document
  remotes/origin/master
3. 切换分支
$ git checkout -b English origin/English
Branch English set up to track remote branch English from origin.
Switched to a new branch 'English'
3. 切换会主干
$ git checkout master
$ 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/vptpwqtx.html