[SOLVED] Newly created folder not added to GIT?

I created a new Arduino project in my project folder in Windows (VScode).
It is not added to Git automatically.
Is this normal?
What do I need to do do either automate the addition to Got (maybe via config setting) or add it manually?

Have you committed the changes (i.e. creation of folder and contents)? And is this going to a remote repository like github or gitlab? If you, you also need to push the commits to the remote.

I have not much of an idea.

I have one workspace / projects folder, in it are other project folders.
I create a new project folders through PIO home.

Today, I created FingerprintEnrol during which the PIO page closed in VScode.
The folder was created (see image below)
I modified main.src, and the folder remained white.

I opened PIO home, created FingerprintReader, PIO closed itself. The folder was created.
I modified the main.src and it turned red.

Did the same thing twice, but got a different outcome.

My git repository seems to be local.

Looking at the folders in Windows file explorer, and I see folder with ticks and exclamation marks:
My new folders have neither; though I have no clue who puts these there; I always assumed Git does this.

What do I have to do, to add these new folders to Git?

The new folders do not show in here either:

My problem is, I have no idea how I set this all up in the first place; as I use VScode and PIO every three months or so, but then for a few days if not weeks, but am concerned with coding only, not with using the environment. :frowning:
And some things in this combo VScode/PIO do not seem intuitive at all (or I am too stupid for it).

[edit] Also, updating the main.src in FingerprintEnrol does not update the Git change indicators, but updating FingerprintReader does. This may be related to PIO home closing on creation of the project folder. Hence, the question: How can I add this folder to Git version control?

Ah ha… I see the problem now… :wink:

Each folder has it’s own .git repository folder… so you need to initalise a new git repo in each of those new project folders. If you have no folders open with source control repos… you’ll be able to click on the + button and can initialise them that way.


Otherwise, you can use the Command Palette , type in git init (for Git: Initialise Repository) and chose the folder to initialise. Alternately, navigate in a terminal to the folder you want to initialise, and run git init to initialise that folder.



Once they’re initialised, you’ll be able to do your initial commit for the current state of the project, and track future changes.

Regarding the folder icons… perhaps you have something like TortoiseGit installed… if so, that’s another way to manage Git repositories.

1 Like

Thanks! This… View | Command Palette | Git Initialise Repository … did work.
It changed the folder in the workspace to green (I have never seen this before; no kidding) and also put green ticks on the Windows Explorer folder.
I have used the Git Initialise Repository menu item before, as it said recently used… and remember having used it.

Yes, I installed TortoiseGit a few years back and could never make sense of it (so never used it).

1 Like

Funny you say that… I don’t remember seeing that before… could be a new behaviour of VSCode or just didn’t notice before…

Maybe it has something to do with windows onedrive.
Look here:

1 Like

It’s possible, but I think it’s more likely that since MaxG confirmed he does TortoiseGit that it’s doing its job, and showing the current commit state of the folders… i.e. the ones with green ticks have no uncommitted changes, the ones with red crosses have un-committed changes, and the ones with no overlay icon have no git tracking folder.

They do look more like the OneDrive icons though than what I remember TortoiseGit’s icons to be though! :slight_smile:

I am not using OneDrive :slight_smile:
Not sure what does the ticks/exclamation marks, but it is in sync with enabling Git.

1 Like