Closed
[Documentation|文档反馈]: 快速入门要求在版本标签检出后执行git pull #6830
aodebiaoAdd on  21 days agoClosed at  6 days ago
aodebiao
aodebiao
21 days ago Create

“进入项目源码”使用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
21 days ago Associated pull request
aodebiaoaodebiao
21 days ago Modify description of issue
yuning_chenyuning_chenCollaborators
21 days ago Assign gxhgxh2475698 as responsible person
CANN-robotCANN-robotCollaborators
6 days ago Close issue
CANN-robotCANN-robotCollaborators
6 days ago Added label: resolved