指定某个git的版本代码拉取新的分支

Author: Bruce Liu Posted on: 2020-08-08 17:09:16 Visited: 512

执行命令列表:

git log

git checkout [commitid]

git checkout master

git checkout -b newbranchname [commitid]

git branch

git push origin newbranchname:newbranchname

详细解释如下

git log

用上述命令,查找历史提交记录,找到指定的版本commit。

git checkout [commitid]

用上述命令,尝试检出到指定版本,确认本地修改已经提交,防止本地有修改未提交

git checkout master

用上述命令,回退到最新版本。

git checkout -b newbranchname [commitid]

用上述命令,对指定版本commitid检出并创建分支newbranchname

git branch

查看目前的分支,确认分支已经创建

git push origin newbranchname:newbranchname

将这个分支push到git服务器




Tags:
git checkout

相关主题:

留言信息:

......期待您的留言!


增加留言、提问或者评论,不用注册,匿名提交,你提交的信息经过审核后才会显示:


© 2008-2022 CunYouLu存有录博客 村友录 存游录 鲁ICP备08005943号