首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >VSCode和Git问题:无法撤消,因为HEAD未指向任何提交

VSCode和Git问题:无法撤消,因为HEAD未指向任何提交
EN

Stack Overflow用户
提问于 2021-02-17 16:05:19
回答 1查看 236关注 0票数 0

我的VSCode有一个问题,当我想撤消上次提交时,弹出消息是“无法撤消,因为HEAD没有指向任何提交”。

但我已经提交了,并且在shell中手动完成了工作。

"output“窗口中的上次日志:

代码语言:javascript
运行
AI代码解释
复制
> git status -z -u
> git symbolic-ref --short HEAD
> git for-each-ref --format=%(refname)%00%(upstream:short)%00%(upstream:track)%00%(objectname) refs/heads/master refs/remotes/master
fatal: unknown upstream: format track

git状态:

代码语言:javascript
运行
AI代码解释
复制
[DEV - -@- -]$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#   (use "git push" to publish your local commits)
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   ---
#       modified:   ---
#       modified:   ---
#       modified:   ---
#
no changes added to commit (use "git add" and/or "git commit -a")

图片VSCode:As you can see, when I commit in VSCode, the synchronize button doesn't show changes

你能帮我修一下git吗?

EN

回答 1

Stack Overflow用户

发布于 2021-02-17 17:15:48

我对自己说,我有git 1.x。我切换到Git2.x,我所有的问题都消失了,奇怪的是VSCode没有警告Git1.x有潜在的bug

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66245658

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档