繁体   English   中英

GIT结帐标签问题-分离的HEAD状态

[英]GIT checkout tag issues - detached HEAD state

该项目的目的是调用不在标准UNIX路径中的代码。

我的教授提供了从GIT存储库克隆gawk的步骤,然后以autoconf格式进行构建和安装。

我的问题是-从git://git.savannah.gnu.org/gawk.git克隆后,我需要更改要安装的版本。 当我使用教授提供给我们的git checkout tags / gawk-3.1.8命令时,我收到以下输出。 当我使用make和make install命令时,我最终使用的是gawk的最新版本,而不是3.1.8。

Note: checking out 'tags/gawk-3.1.8'.
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 perfoming 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 00ef042... Move to 3.1.8

我搜索了几个独立的HEAD状态论坛,但未能找到解决方案。 任何帮助表示赞赏。

这不是错误,一切正常。 注意输出如何显示“ Note:而不是“ Error:或其他内容。

该注释只是告诉您处于“分离的HEAD”状态,如果您仅使用存储库并且不打算推送任何提交,那很好。

您分离的HEAD状态不一定是您需要解决的“问题”。 我了解打印的警告可能会警告您,但这只是Git试图防止您犯错。

分离的HEAD仅表示您的HEAD引用未指向提交以外的任何其他引用。

换句话说:您不在分支上。 这不是需要解决的问题,您应该能够像完成工作一样签出该版本并根据教授提供的说明来构建项目。

在此处阅读更多信息: https : //git-scm.com/docs/git-checkout#_detached_head

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM