Unless I misunderstand your question I think you have a slightly incorrect understanding of how Git, repos and projects work. So let me clarify how it works and then see if your question is answered. Git is just a distributed source control system. Honestly I don't see any benefit in using it without the remote aspect but if that is the way you want to go just be aware that you can royally mess yourself up and potentially lose all your work (and previous versions) so be very, very careful.
Git has the concept of a repository. A repo is just a collection of files (it doesn't understand folders so you cannot have empty ones). In general everything in a repo should be related in some way. Most companies (and people) use a separate repo for each product but the concept of multiple products in a single repo is supported, just harder to work with. The repo is all Git cares about and everything done within Git is at the repo level. Within a repo you can have any files you want (and logical folders by naming the files using folder-like names). At this point this has nothing to do with projects/Visual Studio/code. In order to have a repo you need to either clone an existing repo or create a new one. When you create a new repo a new folder is created with the repo name (by default) and generally a couple of starter files are created. However the most critical content in there is the hidden .git
folder. This is where Git stores all its information. If that folder is ever removed you lose all the repo information. Without a server-backed repo, if you lose this folder then all your history is gone. This is what Git looks for when determining whether a folder is a "repo" or not. Within this hidden folder is the information to link it back to the server-side repo and all your local changes. This is where the stash and commit commands put your changes. Git doesn't care about anything higher than the directory containing the repo so the path to it can be whatever you want. There can be only 1 repo per folder and (ignoring submodules) repos cannot be nested in other repos. A repo is basically the root of the Git world.
Within a repo, if you want to store code then you'll likely create your solution in the folder. Within that solution is one or more projects where your actual code resides. Again, Git doesn't care about any of this, they are just files to it. You can have any # of solutions and projects in a repo.
Getting back to your scenario, as I understand it. The root of your repos is E:\Z_GIT
. That's fine because Git doesn't care. Each person working on that same repo can use a different path because it has no impact on anything. Within this folder is where you would create your first repo. You can do this in VS or via the command line. Let's assume you wanted to create a repo called MyRepo
. Then when you created the repo you would specify the path to be E:\Z_Git\MyRepo
. Within this folder is your repo that Git sees and it would auto-create a .git
hidden folder. Git is file based so any file changes you make in here would be seen by Git when it looks for changes. At this point you could run git status
to see what, if anything, is different.
Within the repo is where you'll create your VS solution and projects. Out of the box VS creates a folder for each solution so let's suppose you created a new C++ project called MyProject
. When you created the project then part of the creation would have been the setting of the solution name. It defaults to the project name but let's suppose you changed it to MySolution
. You would also have to specify a local path. Since you want the project in Git you would specify the base path to be E:\Z_Git\MyRepo
. After the project is created you'd see the solution and project folders as E:\Z_Git\MyRepo\Mysolution\MyProject
. If you use the Git Changes
window in VS then it would show that you have added the folders and files to your repo but haven't committed them yet. When you tell Git to commit the changes then your changes would be saved to the .git
folder and Git Changes would show nothing has changed. However it will tell you that you have local changes (in .git
) that have not been pushed to the remote repo (because you don't have one).