Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VSCode&;Git问题:Can';因为头部没有';不要指向任何提交_Git_Visual Studio Code - Fatal编程技术网

VSCode&;Git问题:Can';因为头部没有';不要指向任何提交

VSCode&;Git问题:Can';因为头部没有';不要指向任何提交,git,visual-studio-code,Git,Visual Studio Code,我对VSCode有一个问题,当我想要撤消上次提交时,弹出消息是“不能撤消,因为HEAD不指向任何提交” 但我已经在shell中手动提交了它的工作 最后一次登录“输出”窗口: git状态: [DEV - -@- -]$ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # (use "git push" to publish your local comm

我对VSCode有一个问题,当我想要撤消上次提交时,弹出消息是“不能撤消,因为HEAD不指向任何提交”

但我已经在shell中手动提交了它的工作

最后一次登录“输出”窗口:

git状态:

[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")
[DEV-->]$git状态
#论分行行长
#您的分支比“原始/主分支”早1个提交。
#(使用“git push”发布本地提交)
#
#未为提交而暂存的更改:
#(使用“git add…”更新将提交的内容)
#(使用“git签出--…”放弃工作目录中的更改)
#
#修改:---
#修改:---
#修改:---
#修改:---
#
未向提交添加任何更改(使用“git add”和/或“git commit-a”)
图像VSCode:


你能帮我修好git吗?

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

[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")