• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating a Git Server
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a Git Server


  • Subject: Re: Creating a Git Server
  • From: G Brown <email@hidden>
  • Date: Sat, 13 Oct 2012 19:53:35 -0400

I did remember a few things. Mr. Google would probably tell you, but I will save you some time.

Put in your ~/.gitconfig

[http]
sslVerify = false
postBuffer = 524288000

Why? I use https urls (passwords and all) so git has its own store of certificates to mess with, so I just turned that off. Also, this git protocol feature is efficient because it packs lots of little files into big chunks, the chunks are so big that there will be problems posting that with the http(s) protocol without the buffer enhancement.

Also, often when there are problems it is because--for me--I am using the wrong account or wrong password. This is especially noticeable when you try to push.

The apache options are from the dav protocol; I should review that documentation someday.....and see if I need all that or what..
<LocationMatch "^/git/.*/git-receive-pack$">
        AuthType Basic
        AuthName "Git Access"
        <Limit GET HEAD OPTIONS CONNECT POST PROPFIND PUT DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
                Require group  svnrw
        </Limit>
</LocationMatch>

Any luck?


G Brown
email@hidden




On Oct 9, 2012, at 7:43 PM, G Brown wrote:

Standard Mac os x 10.6 (snow leopard)
java 1.6
macports
git  1.75

I already had DAV going.  All DAV does is allow me to put the initial repository on to the server. If I didn't have that then I would have to somehow copy the repository to the correct location on the server.

There are instructions from Apple and on the web on how to enable DAV .  or if you don't have a lot of projects you could skip Dav and just copy them to some directory.

All you need to do, I believe, is figure out what directories you want to use and modify that git_config file. And of course, you need to put a directive in  /etc/apache2/httpd.conf to include that file, or alternatively insert the statements directly into it.

It is working for me. I may have done something else, but I can't recall it now. 

To create a new repository I make a bare clone of a project, then copy it to the correct directory which is attached to my machine by the dav protocol. Once that is there I can link to it via the http-git-backend or of course clone it on to other machines. Access is controlled by Apache. You could put people into a group; I use the same group that I use for subversion, which in that config file is svnrw.

I think it is easy, with the http://email@hidden/git/projectA.git urls.

G Brown
email@hidden




On Oct 9, 2012, at 5:49 PM, Roger Perryman wrote:

What is your exact configuration? Your approach sounds intriguing, if not too easy. Every approach I have tried so far resulted in needing to update something.

What I have is:
OSX Server 10.5.8
Java 1.6
MacPorts (just downloaded, need to start adding modules)
Git 1.7.6

Do you have any documentation on the steps you took to install everything and get it to work?

Thanks,

Roger


On Oct 8, 2012, at 8:49 PM, G Brown wrote:

Hello,

I use Mac OS X server. Or maybe a better thing to say is I use Apache 2.

I have found that the get documentation is–I know this is shocking for an open source project–not quite current. Specifically the git protocols have incorporated a very efficient HTTP transfer mechanism, which is not talked about too much. Most of the documentation seems rooted in the past prior to when this efficient HTTP protocol was incorporated.

The protocols pack up all the small changes and transmit them is a large packet, much like the SSH protocol. The advantage of using the HTTP protocol is that it easily passes through corporate firewalls, whereas the SSH protocol is often blocked.

What I did to convert my server into a private github was the following:

1. Turn on DAV. You can stop there, but you will have an inefficient transfer. DAV is good for creating the initial bare repository.

2. Include the attached HTTP directives in the git_support.conf file for Apache 2. This allows the execution of git code which does the packing and the packing. The example attached file is using directories specific to how I have set up the server. You may want to change the locations of the directories. Also I am using the Macports git, so you will see locations like:
/opt/local/libexec/git-core/git-http-backend/

for the executables of git.

Now my repositories have urls like https://email@hidden/git/myrepository.git. 

I even use these type of urls with github; it works fine.



G Brown
email@hidden


<git_support.conf>

Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Creating a Git Server
      • From: Klaus Berkling <email@hidden>
References: 
 >Creating a Git Server (From: Roger Perryman <email@hidden>)
 >Re: Creating a Git Server (From: G Brown <email@hidden>)

  • Prev by Date: Re: Sorting "to many" relationship
  • Next by Date: New blog
  • Previous by thread: Re: Creating a Git Server
  • Next by thread: Re: Creating a Git Server
  • Index(es):
    • Date
    • Thread