How to properly determine a Git repository's URL

170 Views Asked by At

I'm fighting my way through Git + Apache and loosing.

More specifically:

  • I installed Git under Windows7 64 bit (went to git-scm.com/download/win)
  • Configured git via cmd.exe (filled in my name, e-mail, etc)
  • Created a repository on my machine (created a folder C:\RepoGitPlayground, navigated to it via cmd, did a "git init", added some dummy file to the repo, then "git add .", then "git commit" followed by some message)

Next, I need to clone the repository using https. Since my machine was already host to a Visual SVN Server installation, and knowing that it comes bundled with an Apache server, I figured I would use that. My understanding of how to persuade Apache to serve Git repositories via https comes from this tutorial: http://blog.subgit.com/visualsvn-subversion-server-and-git/

According to it:

  • I augmented the Apache installation with the file mod_cgi.so (what a fight...it was missing originally, as Visual SVN Server only comes with a reduced version of Apache)
  • added the following content to httpd-custom.conf file (an Apache configuration file):

    LoadModule cgi_module bin/mod_cgi.so

    LoadModule authz_user_module bin/mod_authz_user.so

    SetEnvIf Request_URI "^/git/.*$" GIT_PROJECT_ROOT=C:/RepoGitPlayground

    SetEnvIf Request_URI "^/git/.*$" GIT_HTTP_EXPORT_ALL 1

    ScriptAlias /git/ "C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe/"

    Options +ExecCGI

    Require valid-user

    AuthName "Visual SVN Server"

    AuthType Basic AuthBasicProvider file

    AuthUserFile "C:/Repositories/htpasswd"

Necessary info for the reader: "Visual SVN Server" from above (in the script) is the Windows account name under which stuff is happening. The password for it is filled_in in C:/Repositories/htpasswd.i_was_expecting_some_extension_here_but_it_has_none

Configured this way, Apache should now (according to the tutorial) be able to successfuly fulfill my following wish: "git clone htps://Visual_SVN_Server@localhost/git/RepoGitPlayground C:\SomeNewFolder".

When asked to do that, it says - fatal: repository 'htps://Visual_SVN_Server@localhost/git/RepoGitPlayground' not found

At this point my brain bluescreens.

Mentions:

  • inside the RepoGitPlayground folder I can see the customary file structure: a hidden .git folder that contains the usual "hooks, info, logs, objects, refs" folders along with the config, description, HEAD, index, etc. files. Classical, by_the_book Git repository structure.

  • also, under MyComputer, if I right click the RepoGitPlayground all the customary Tortoise Git options appear (they don't appear in relation to any_other_ordinary_non_Git_repository folder)

As far as I know, I pointed Apache in the direction of a valid, legitimate Git repo. Don't know why it can't "find" it.

Considering again the command "git clone htps://Visual_SVN_Server@localhost/git/RepoGitPlayground C:\SomeNewFolder", I must admit that I don't understand how and why the address gets pieced together like that.

The first part: htps://Visual_SVN_Server@localhost looks like just some normal URL. The kind of stuff people use on the web.

The second part, /git/RepoGitPlayground looks more like a windows_style_hard_disk_path, and that's suprinsing to me, did not expect the 2 to mix together like that.

Furthermore, yes, I recognize the RepoGitPlayground part, it's a folder that I created with my own hand...But I don't know who "git" is (that comes before it). Afterall, my folder resides in C:\, not in C:\git. However, seeing that in the script above I wrote in line 3:

"SetEnvIf Request_URI "^/git/.*$" GIT_PROJECT_ROOT=C:/RepoGitPlayground"

I thought of "git" as being just an alias for C:/RepoGitPlayground. Consequently, I tried modifying the clone command to git clone htps://Visual_SVN_Server@localhost/git C:\SomeNewFolder, but the result was exactly the same: repository not found.

Another point of confusion for me: I read lots of other discussion that referred to the repository in terms of htps://something_in_the_middle/repo_name.git

It's the last part that gets me: name_of_repository.git. How come? According to the theory, you have some folder (your repository) and INSIDE OF IT you have a hidden folder called simply ".git".

Pointless to say, I tried this way as well (adding a .git "extension" to RepoGitPlayground in the command line) but it didn't work either.

I've been fighting this for the last week, and unless a solution comes my way soon, then my resignation_of_honor must go the manager's way. Really grateful for any help...

Throughout the text I deliberately omitted a "t" in "https"; I have plenty of those as arguments to "git clone" command and StackOverflow interprets them as being links; I must have at least 10 reputation points to be able to post more than 2 links; this is my first post ever, I have no reputation at all (however, they are really NOT links).

0

There are 0 best solutions below