Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a New Git Repo from existing files on Windows

Tags:

git

I'm trying to use Git on my local Windows machine only. I have an existing project that I want to move into Git. I'm not quite sure how I should structure the workflow. Should I make that existing project folder the main repo for my project and then create other branches off of that? Or should I create one central location for all Git repos, copy my existing project files there as the main repo, then just check out my project from the central repo into a new folder?

A similarly worded question would be, should there be one central Git folder where all of your repos live or should there be main repos (trunks?) scattered around per project?

I guess this question only makes sense when running and using Git locally. When using it against a true remote repo, then it seems to makes more sense.

like image 993
traughber Avatar asked Aug 22 '12 20:08

traughber


People also ask

How do I create a Git repository in Windows?

Creating a Bare Git Repository for a new project is three-step process: Create a New Project/Folder. Browse to New Project. Initialize Git Repository for the Project.


1 Answers

You can directly create your Git repo within the folder of your main project.
They will be added by default in the master branch.
(cd c:\path\to\yout\project && git init . && git add . && git commit -m "first commit")

No need for a "central" folder where all your git repos should live.
Each Git repo can evolve directly where each project is.

like image 137
VonC Avatar answered Sep 23 '22 09:09

VonC