How To Create a Networked Git Repository on Windows From Scratch (in less than 60 seconds)

Everything I found out there to do this was either wrong, had typos, or said it was for a ‘Remote’ (networked) repository, but they were talking about Github, or something else… I wanted at least one post on the Internet to be accurate, and do what it said it was going to do. Here is a nice overview of what Git is/does:

Examples of development flow with Git

If you work alone, or in a very small group, Subversion is awesome. It’s all I’ve ever known-refusing to even learn the antiquated CVS. SVN can do things I’m not aware other software versioning systems can do, like allow you to version MS Office documents and plain text files. There are tons of utilities out there for SVN, too, and it is very nicely integrated into Visual Studio (VisualSVN), and your normal Windows desktop as TortoiseSVN.

Being new to Git, but needing a repository system that was much more ‘release aware’, I put in Git, and immediately found out how difficult it was to find good, correct information on it’s setup & use. This post is the result of that frustration-not just for my reference, but for yours as well… :)

Here we just create a fresh, empty repository on a file share (share location: D:\GitRepos\testRepo, local directory will be C:\Users\Pat\testRepo (filename created when checked out)):

note: In the above, even though my repo is on the same box as my local checkout, I am showing here the way other users, and myself, can get to it to show you it is, in fact, a network shared repository.

C:\Users\Pat\testRepo>git commit -a
On branch development
Untracked files:inDevelopmentBranch<— the file we just created is in the local working dir, but just like in SVN, it has not been ‘added’ to version control

nothing added to commit but untracked files present

C:\Users\Pat\testRepo>git add inDevelopmentBranch

note: You can also do: “git add *” to add all, or any other wildcards…

C:\Users\Pat\testRepo>git commit -a
[development 32a74f0] This is the first commit for the development branch… testRepo is the repository…
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 inDevelopmentBranch