1

I'm little bit confused when I setup Git. I have local Repository at my C:\Repository and root my project is located at C:\Projects. I want to ask should I create repo file into work project folder or not to be applied to commit and push to local repo?

Alec
  • 1,178
  • 5
  • 20
  • 2
    For what it's worth, I find it easiest to have one git repository per solution (folder). – lzcd Mar 14 '13 at 23:50
  • You might be interested in this question if you choose to keep them separate [Can I store the .git folder outside the files I want tracked?](http://stackoverflow.com/q/505467/164966). That said, you shouldn't split git up that way, you should keep the local repository in the project folder. It's pretty much how everyone else does it. – Roman Mar 14 '13 at 23:58

1 Answers1

1

If I get it right, you have a project in C:/Projects and a repository in c:/Repository and you want to push changes from the project repository into the c:/Repository.

Here how you can setup all this (I assume, you use Git for the Windows and not Cygwin git):

$ mkdir -p /c/Repository/MyProject.git
$ cd /c/Repository/MyProject.git
$ git init --bar                   # Create "server" (bar) repository

$ mkdir -p /c/Projects/MyProject
$ git init                         # Create project repository
$ git config user.name "My Name"
$ git config user.email "My@e-mail"

$ # set more properties...

$ # create some files
$ # ...

$ git add -A .                     # Add new files to the index
$ git commit -m "Initial commit"
$ git remote add origin /c/Projects/MyProject
$ git push origin master:master
Boris Brodski
  • 8,425
  • 4
  • 40
  • 55
  • Nice... But don't you think this Git thing is alarmingly complex to the point where you have to question its productivity? I mean SO is loaded with the most basic Git questions by some very competent people. Software should be coded by people who have Aspberger, but should be designed by people who have ADHD! – ATL_DEV Jan 23 '14 at 02:20