Files 'dragged and dropped' into solution explorer in Visual Studio Community 2022 can't be tracked in git?

114 Views Asked by At

I wanted to try dragging and dropping files from Windows Explorer in to the Solution Explorer, and it seemed to work at first. However I realised after commiting and pushing my changes to git that I couldn't see any of the .cpp or .h files I dragged in and have no idea why.

I've noticed that these files aren't showing up the same as a source file that is added by right clicking in solution explorer and clicking Add >> New item. The files I dragged and dropped in have the plus icons: dragged_in_files

But are missing the padlock symbol that I can see on files that are checked in, basically on every other file in my solution explorer: added_in_files

On the files I have dragged in, I don't get any Git options when I right click on them, I can't see them in Windows Explorer in the project folder. I even tried excluding the files from the project just to see what would happen, but I didn't expect that they would complete disappear and are not even visible when I enable 'Show All Files' in the Solution Explorer.

I've only used Visual Studio Community Ed. for a while now and I'd just like to know how I can rectify this or enable the files to be tracked in my repo as it doesn't seem like they exist anywhere but in the IDE only.

0

There are 0 best solutions below