码迷,mamicode.com
首页 > 其他好文 > 详细

git 命令

时间:2020-01-22 11:17:47      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:stat   ref   删除   cti   ret   min   state   需要   com   

1. 需要指定某个版本的代码,不是最新的

1.1 首先

git pull

把代码更新到最新

1.2

git log

会出来:
commit 6c182f8c2a98665d73a92dd13127503e9f0289c1
Author: hello hello@123.com.cn
Date: Tue Jan 21 16:43:03 2020 +0800

ignore

commit 268976392e0935b4524f287935c1a16be9afc5d0
Author: hello hello@123.com.cn
Date: Tue Jan 21 16:22:27 2020 +0800

将base/utility合并,删除冗余

代码

commit 076bd5c5426a1c257343c98054d8cad582c079f1
Author: hello hello@123.com.cn
Date: Tue Jan 21 11:49:29 2020 +0800

代码精简

commit 9348818c3606e5ed80e4f63e2b657635dadd7711
Author: hello hello@123.com.cn
Date: Tue Jan 21 10:18:02 2020 +0800

1.3

git checkout 9348818c3606e5ed80e4f63e2b657635dadd7711

“9348818c3606e5ed80e4f63e2b657635dadd7711”就是上面某个commit id
会显示:
Note: checking out ‘9348818c3606e5ed80e4f63e2b657635dadd7711‘.

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

HEAD 目前位于 9348818...容错降为2

git 命令

标签:stat   ref   删除   cti   ret   min   state   需要   com   

原文地址:https://www.cnblogs.com/yanghailin/p/12227924.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!