dockervisual-studio-codegithub

VSCode keeps prompting me to commit changes to a docker-compose file, don't know how to prevent it


Sorry this is such a rudimentary question, but I'm new to both VSCode and GitHub, and don't want to unintentionally overwrite someone else's work.

I am using the "Remote - SSH" extension in VSCode to control my Apple Mac Mini (which is running Debian 12 and a bunch of Docker containers).

I tried to install Portall, which runs as a Docker container. I had problems doing so, and the developer suggested git cloning his repo.

Not really knowing what I was doing, after some Googling, I figured out:

apt install gh
gh auth (logging into my GitHub account)
gh repo clone need4swede/Portall

I was then able to make some slight changes to the file at /Portall/docker-compose.yml (adding in my secret key and changing the port bindings to suit my environment), and then do docker up. The container was then up and running just fine.

However, now I have a little 1 on the Source Control icon in the VSCode side-bar, and if I click on it, it's showing me the changes I made to /Portall/docker-compose.yml (on my own computer), and giving me the option to commit the changes. I am assuming this means it'll upload these changes to the Portall repo on Github itself.

Obviously, I don't want to do that and stuff up someone else's work. What should I do to get rid of this prompt to commit the changes?

I have attached a screenshot...

Thanks in advance.

enter image description here

If I right-click the file and click "discard changes", it reverts the file on the Mac Mini back to what it was when it was first downloaded (without my secret key and port bindings). This, of course, isn't ideal...

The answers given for this question suggest clicking the profile icon in the lower-left and clicking "log out", but in my case, it says "You are not signed into any accounts".

This answer in particular suggested disabling the "Github: Git Authentication" setting in VSCode. I tried that and clicked the refresh button in the source control file list, but the file remains there, await commit. I also saw in that same answer, "Git: Ignored Repositories". I wondered if that might do the job. I clicked "Add item" and entered "need4swede/Portall", pressed OK, then refreshed the list again, but the file remains in that list to be committed.


Solution

  • Ok, disabling Git Authentication in the settings and having the repo listed in "ignored repositories" (as explained at the end of my original post) actually does solve the problem, if you restart VSCode.

    That is to say, the answer to my problem was to have Git Authentication disabled, the repo listed in "ignored repositories", and then restart VSCode entirely.