git 项目切换分支 命令

在项目开发总,一般都会用到git管理工具,有的公司可能还是用的svn;不管怎么样。用的顺手就行;

来说下git 的基本使用

git clone + 项目地址链接; 可以把项目克隆到本地;

然后一般顺序是

$ cd gap-official-site  // 这里是进入到项目的文件夹中
// 查看分支 这里是看的本地的分支
$ git branch
* master  

 接着是查看远程分支

 

$ git branch -a  // 查看远程分支
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/cherry-pick-2bf56ac3
  remotes/origin/cherry-pick-42525e75
  remotes/origin/cherry-pick-939d6f79
  remotes/origin/cherry-pick-966bced7
  remotes/origin/cherry-pick-eda5f5ca
  remotes/origin/cherry-pick-f6dcc5e6
  remotes/origin/cherry-pick-f7232894
  remotes/origin/feature-0.0.1
  remotes/origin/feature-0.0.10
  remotes/origin/feature-0.0.2
  remotes/origin/feature-0.0.3
  remotes/origin/feature-0.0.4
  remotes/origin/feature-0.0.5
  remotes/origin/feature-0.0.6
  remotes/origin/feature-0.0.7
  remotes/origin/feature-0.0.8
  remotes/origin/master

 然后切换到当前正在开发的分支下

1 $ git checkout -b feature-0.0.10 origin/feature-0.0.10
2 Switched to a new branch 'feature-0.0.10'
3 Branch 'feature-0.0.10' set up to track remote branch 'feature-0.0.10' from 'origin'.

显示上面的内容就表示已经切换成功了!

不放心再用命令查看下你当前所在的分支

$ git branch
* feature-0.0.10
  master

 现在可以开始 修 bug 了 哈!  

转载于:https://www.cnblogs.com/ssdtor/p/10173681.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值