Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What should the actual path to a git repository 'file' be? It's common practise when cloning from github to do something like:

git clone

And I'm used to that.

If I init a repo on my local machine using git init, what is the 'git file' for me to reference? I'm trying tot setup Capifony with a Symfony2 project and need to set the repository path. Specifying the folder of the repository isn't working. Is there a .git file for each repository I should be referencing?


So for example, if I do the following:

mkdir /path/to/project cd /path/to/project git init

What should my path be to reference that git repo?

  • /path/to/project?
  • /path/to/project/?
  • /path/to/project.git?
  • /path/to/project/.git?


So this is an excerpt from the Capifony config:

set   :application,   "My App"
set   :deploy_to,     "/var/www/"
set   :domain,        ""

set   :scm,           :git
set   :repository,    ""

role  :web,           domain
role  :app,           domain, :primary => true

set   :use_sudo,      false
set   :keep_releases, 3

I need to set my repository to a local repo, which I've been trying to do with all combinations of the previous paths like:

set   :repository,    "file:///c:/path/to/repo.git"

But no path works to my (valid) git repo?

share|improve this question
up vote 4 down vote accepted

When you use the command git init it initiates an repository in the folder your bash is located at that moment. It will create a folder .git and all the folders and files that belong to the same parent folder might be added to the git repository.


git init command

Will result in:

folder schema for a git repository

Realize this is an hidden folder.


To push to a local repository you will need to create a second repository using the command git init --bare, it will make the repository pushable. Let's consider you created the second repository at c:/path/to/repo, so, it will have the .git folder in it.

With your bash at the first git repo, use git remote add origin file:///c:/path/to/repo.

Then push the first repo to the origin by using push origin --all, it will push to the second repo you created.

share|improve this answer
So should I use that hidden .git folder as my path? – Anonymous Jul 3 '13 at 12:22
Can you give me an example of when you need the path? – Math Jul 3 '13 at 12:23
I just saw your EDIT now, anyway, it is still not clear for me of when the hard path is needed. – Math Jul 3 '13 at 12:25
I added a second edit with what I'm trying to do/an example. – Anonymous Jul 3 '13 at 12:26
If you want to make a local repository you will need to use the command git init --bare to initiate your repository you want to push to. Them, use the path without .git. I'll edit my answer. – Math Jul 3 '13 at 12:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .