Search code examples
gitgit-extensions

How to setup local version control with GitExtensions?


So I'm new to version control, but have read the documentation of GitExtensions but it was of limited help because it focused on dealing with remote repositories.

What I need is to have version control for my local projects. I have Android and Visual Studio projects I work on as the only developer, so the source is all on my local computer. I do not want to put the source up in GitHub or anywhere on the internet yet. For now I just want to setup and use the version control local on my own PC.

I have GitExtensions installed, and created a local repository at C:\Programs\gitrepos\projectname\ My code is at C:\Projects\projectname\.

My first problem is that I do not understand how to specify the location of my source files?! I see setting remote source, but I am not using remote sources. Did I do this wrong? Should the repository be in the same folder as my source files? Nothing I've found thus far explains how git or gitextensions works when dealing with local-only source that you want to version control.


Solution

  • A git repository works from a certain root directory downwards. This root directory will contain a folder named .git. All the information of your versioning history is saved in that one folder

    If you want to version specific files, they must be in your "repository". This means they have to be in or below the folder that contains the .git folder.

    In other words, your last idea is correct and you should have created the repository at C:\Projects\projectname