skip to Main Content

I just added my repository to vscode source control (using the Initialize repository button) and it now says I have 1800 changes. In Github Desktop it correctly shows two changed files. What should I do?

Should I remove the repository from vscode and how and then readd it back in? Is there a way to check where vscode is getting the repository? Maybe it is checking the wrong directory? Or maybe it is correct and github Desktop is incorrect?

vscode:
enter image description here

github desktop:

enter image description here

Note:
My folder that is open in vscode is a subfolder of the main repository.

Example:

/mygitproject
/mygitproject/workingfolderinvscode

Before:

enter image description here

Update:
Restarting vscode popped up this message:

enter image description here

Closed the project and opened the parent folder and got the same message mentioned above. This time some folders and files are unchanged and others are untracked. Adding right side of file explorer (screenshot below). Actually, on opening the folders I see that all the files all untracked and now the folders show untracked.

enter image description here

Update:
I’ve opened the source control view now, after opening up the parent branch and I see two repositories listed. The top one shows the correct number of changes and the bottom one the incorrect.

enter image description here

UPDATE:
It looks like if I right click on the name of the repository I get a few options including, "Close Repository".

enter image description here

I’m going to close the repository that shows as the subdirectory and keep the repository that includes the projectd from it’s root directory.

Great success!

It is showing up correctly.

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    Apparently, vscode did not like that I had a sub folder open instead of the root folder (the one with git folder).

    I then opened the folder that had the git folder in it.

    It then showed two repositories.

    enter image description here

    To close the first repository, I right clicked on the repository name in the source control panel and chose, "Close repository".

    enter image description here

    It now shows the correct information.

    But that is not all. When I reopened the project the first repository opened again causing the same issue as before. I found a .git folder in the subdirectory and have deleted it.


  2. My guess is, your VSCODE is showing all the files in the main directory that has changed. Not only the ones in your subdirectory. Gis status can give more details about.

    But in the source control tab of VSCode you can select the files you want to commit and push if necessary.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search