已关闭
[Documentation|文档反馈]: 快速入门要求在版本标签检出后执行git pull #6830
aodebiao创建于  19 天前关闭于  4 天前
aodebiao
aodebiao
19 天前 创建

“进入项目源码”使用git clone -b版本号和git checkout ${tag_version}下载或检出配套版本,随后要求源码已存在时git pull。若目标是版本标签,Git会处于detached HEAD,git pull没有当前分支的上游,直接报You are not currently on a branch,无法按指南完成更新。

修复区分标签检出与开发分支更新:用git status查看状态,获取远端标签后checkout目标版本;只在相应开发分支中使用git pull --ff-only。

验证

用临时本地源仓、bare远端和版本标签v1实际复现:git clone --branch v1后git pull退出码1,提示You are not currently on a branch;改为git fetch origin --tags与git checkout v1后均成功,git describe --tags --exact-match返回v1。不修改任何生产仓库或算子代码。保持原文CRLF换行。

关联 PR:https://gitcode.com/cann/ops-nn/pull/12197

likedislike
aodebiaoaodebiao
19 天前 关联了pull request:[Docs] 快速入门要求在版本标签检出后执行git pull
aodebiaoaodebiao
19 天前 修改了issue 的描述
yuning_chenyuning_chen成员
19 天前 将 gxhgxh2475698 设为负责人
CANN-robotCANN-robot成员
4 天前 关闭了 issue
CANN-robotCANN-robot成员
4 天前 添加了label:resolved