关于git checkout版本

andy@AndyMacBookPro:/usr/local/webdata/andy/js/jquery$ git checkout 1.8.3
Note: checking out '1.8.3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 869704b... Include distribution in release tag

然后我看到有一大堆输出,以为错了,就没有细看,直接使用了这个命令:

andy@AndyMacBookPro:/usr/local/webdata/andy/js/jquery$ git checkout -b 2.1.1
Switched to a new branch '2.1.1'
andy@AndyMacBookPro:/usr/local/webdata/andy/js/jquery$ git branch -a
  1.2.6
  1.3
  1.8.0
* 2.1.1
  master
  remotes/origin/1.11-stable
  remotes/origin/1.x-master
  remotes/origin/2.1-stable
  remotes/origin/HEAD -> origin/master
  remotes/origin/compat
  remotes/origin/master
  remotes/origin/standard-then
  remotes/origin/standard-then-tests
  remotes/origin/standard-then-tests-fixed
andy@AndyMacBookPro:/usr/local/webdata/andy/js/jquery$

然后结果就是上面这样了,当然,我现在知道问题在哪里了。。。哈哈,git checkout 1.2.6,就是将版本切换到1.2.6这个Tag,我们可以看下jquery的tag:

andy@AndyMacBookPro:/usr/local/webdata/andy/js/jquery$ git tag
1.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0a
1.1
1.1.1
1.1.2
1.1.3
1.1.3.1
1.1.3a
1.1.4
1.10.0
1.10.0-beta1
1.10.1
1.10.2
1.11.0
1.11.0-beta1
1.11.0-beta2
1.11.0-beta3
1.11.0-rc1
1.11.1
1.11.1-beta1
1.11.1-rc1
1.11.1-rc2
1.11.2
1.1a
1.1b
1.2
1.2.1
1.2.2
1.2.2b
1.2.2b2
1.2.3
1.2.3a
1.2.3b
1.2.4
1.2.4a
1.2.4b
1.2.5
1.2.6
1.3
1.3.0
1.3.1
1.3.1rc1
1.3.2
1.3b1
1.3b2
1.3rc1
1.4
1.4.0
1.4.1
1.4.2
1.4.3
1.4.3rc1
1.4.3rc2
1.4.4
1.4.4rc1
1.4.4rc2
1.4.4rc3
1.4a1
1.4a2
1.4rc1
1.5
1.5.0
1.5.1
1.5.1rc1
1.5.2
1.5.2rc1
1.5b1
1.5rc1
1.6
1.6.0
1.6.1
1.6.1rc1
1.6.2
1.6.2rc1
1.6.3
1.6.3rc1
1.6.4
1.6.4rc1
1.6b1
1.6rc1
1.7
1.7.0
1.7.1
1.7.1rc1
1.7.2
1.7.2b1
1.7.2rc1
1.7b1
1.7b2
1.7rc1
1.7rc2
1.8.0
1.8.1
1.8.2
1.8.3
1.8.3+1
1.8b1
1.8b2
1.8rc1
1.9.0
1.9.0b1
1.9.0rc1
1.9.1
2.0.0
2.0.0-beta3
2.0.0b1
2.0.0b2
2.0.1
2.0.2
2.0.3
2.1.0
2.1.0-beta1
2.1.0-beta2
2.1.0-beta3
2.1.0-rc1
2.1.1
2.1.1-beta1
2.1.1-rc1
2.1.1-rc2
2.1.2
2.1.3
andy@AndyMacBookPro:/usr/local/webdata/andy/js/jquery$

其中git checkout可以切换到version,也可以切换到tag。

而那个git checkout -b,是指在本地创建分支。。。我傻乎乎的去创建了分支,结果git branch -a,就看到了本地有这么多版本。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值