如何解决Git Branch 看起来有些奇怪?
我的分支看起来像这样
用户名((8dad1cf...)*)项目名称
不知道如何摆脱它。 正在尝试一些提交命令, think 应用了一个 merge ,并删除了它的命令。 任何人都可以请帮助和帮助
在它到达之前它是 (|REBASE-m)
git 状态回放
$git status
HEAD detached from 3592c28
Changes not staged for commit:
(use "git add <file>...`enter code here`" to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
解决方法
我认为问题在于您处于 HEAD detached
模式。
长话短说:您不是在当前分支上进行最新提交,因此您可以假设它是“只读”模式。
使用:
git checkout xxx
其中 xxx 是分支名称/最新提交哈希。
,应用“git checkout master” 结果
$git checkout master
Switched to branch 'master'
M README.md
Your branch and 'origin/master' have diverged,and have 2 and 3 different commits each,respectively.
(use "git pull" to merge the remote branch into yours)
Username (master *) project name
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。