Using git within Visual Studio: Cannot pull because there are uncommitted changes

Marscaleb 26 Reputation points
2021-06-20T04:47:30.447+00:00

I am very new to using gits and version control (and extremely frustrated by the lack of tutorials designed for people who don't already understand this stuff.)
I am just trying to use git so I can keep my files up-to-date between two computers.
I've got a project set up within Azure and I'm using the Git functionality within Visual Studio. I've managed to get my first batch of files successfully pushed on my main computer and pulled onto my travel computer. Next I made another push with a second batch of files.

However when I went to pull the files on my travel computer, I get this error: Cannot pull because there are uncommited changes.

First of all, this is BS because I have literally changed nothing on my travel computer. The file it claims I changed is ".vs/sinx.sqlite" which I'm guessing is a file visual studio created and used since it is in the .vs folder. (Just a guess, CMIIW) So my first thought is that this is probably a file that I'm supposed to ignore anyway since it's something internal to visual studio. I have an ignore file that I copied from here since they were also working with Unity so I figure that also ignores the Unity files I don't want to override. I see .vs/ in that file so I guess it should ignore the .vs folder entirely. I don't see the gitignore file on my travel computer so I copy it over manually. (Kind of dumb that I would have to do that but whatever.)

But I still get the same error when I try to pull.
I go to the changes list, select that file, and tell it to undo the changes. But it still gives me the error.

What am I doing wrong here?
I don't understand even half of what this process is so I'm sure there is some simple setting or option that I've missed.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,180 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Ken Tucker 5,851 Reputation points
    2021-06-20T11:25:27.01+00:00

    Scott Hanselman has some videos on Git

    https://www.youtube.com/watch?v=WBg9mlpzEYU

    And Dr G

    https://www.bing.com/videos/search?q=dr+g+git&docid=608023814239822504&mid=A31E10514340C60C1B8EA31E10514340C60C1B8E&view=detail&FORM=VIRE

    In a command prompt in the folder your source is in type git status
    this will tell you what files are not checked in. You can undo changes or stash the changes to allow yourself to do a pull

    https://www.cm3solutions.com/cannot-pull-because-there-are-uncommitted-changes-commit-or-undo-your-changes-before-pulling-again/


  2. Tianyu Sun-MSFT 31,086 Reputation points Microsoft Vendor
    2021-06-21T07:00:18.063+00:00

    Hi @Marscaleb ,

    Welcome to Microsoft Q&A forum.

    Have you changed something on your remote repo/server/Azure DevOps? Such as modifying/adding the codes/projects/files? If you changed some of them, please Commit the changes on DevOps and then try to Pull again.

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

  3. Marscaleb 26 Reputation points
    2021-06-22T05:21:45.707+00:00

    EDIT: I guess it was a random bug in the system.
    After I closed the program and tried again the next day I found I was able to do it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.