Visual Studio代码源控件已满 [英] Visual Studio Code source control is full

查看:216
本文介绍了Visual Studio代码源控件已满的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用GitHub,我想我在Visual Studio Code中弄乱了一些东西.正如您在源代码管理屏幕截图上看到的那样,它具有5000项更改,当我尝试使用放弃所有更改或取消所有更改的功能,将弹出此错误:

I just started using GitHub and I think I messed up something in Visual Studio Code. As you can see on the Source Control screenshot it has 5000 changes and when I try to use Discard all changes or Unstage all changes functions, this error pops up:

Git: warning: failed to remove AppData/Local/Comms/UnistoreDB/USS.jtx: Invalid argument

仅当我打开一个特定项目但从未在该项目上使用任何git命令时,才会发生此问题.

This problem only occurs when I open one specific project, but never used any git commands on this project.

推荐答案

似乎您在错误的目录中找到了git repo. git repo的根路径似乎是C:\Users\bekas\AppData\Local,而您要由git控制版本的项目似乎在C:\Users\bekas\AppData\Local的子文件夹中.要解决此问题,可以使用以下步骤:

It seems you located the git repo in the wrong directory. The root path for the git repo seems C:\Users\bekas\AppData\Local, while the project you want to version controlled by git seems in a subfolder of C:\Users\bekas\AppData\Local. To trouble shooting the issue, you can use below steps:

  • 检查根git repo路径

在终端窗口中,使用命令git rev-parse --show-toplevel.输出路径是git repo所在的位置.如果您不需要该目录由git进行版本控制,请转到该目录并删除.git文件夹.

In terminal window, use the command git rev-parse --show-toplevel. The output path is where the git repo located. If you don’t need the directory to be version controlled by git, go to the directory and delete the .git folder.

检查项目路径的根

转到项目所在的根目录,并检查是否有.git文件夹(由git repo管理).如果不是,请使用git init通过git repo管理此项目.

Go to the root directory where your project located, and check if there has .git folder (managed by git repo). If not, use git init to manage this project by git repo.

这篇关于Visual Studio代码源控件已满的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆