Im all aware about services like github and such which provide a really nice system for everything. But what I want to know is, can I use my own webserver?
The server is not owned by me, im in a shared host. So this is not my own box I can make modifications to.
I dont need a fancy front end, I dont need any extra mumbo-jumbo, quite simply I just want to be able to clone and push to a bare git repo on this webserver.
What ive tried so far, is initializing a bare repo on my local drives, cloning it somewhere else, and comitting a blank readme, then pushing that to the “remote” repo.
I think made a 755 directory on my server called “git” and then uploaded the bare git repo (in this case its a folder called test.git) to this directory. so the directory is
/git/test.git
However when I attempt to even just clone this, i get
Cloning into test… error: The requested URL returned error: 500
while accessing http://blackjaguarstudios.com/git/test.git/info/refsfatal: HTTP request failed
So there’s obviously something im not doing, question is, is it even possible?
I don’t care about security really, im just looking for a tad more privacy than paying for github private repos for slightly more sensitive stuff, but nothing earth shattering if someone found them :p
Yes, this is absolutely possible. Serving that via HTTP is relatively complex, and you didn’t mention anything about how you configured your web server to serve the
/gitpath, so can’t specifically advise on that. You probably want to do something akin to http://progit.org/2010/03/04/smart-http.html if you do want to serve by HTTP though.On the other hand, the easy way to do this is to use a SSH remote:
That will give you full read/write access over the SSH connection, and allow you to push and pull to that remote safely. No server, and no credentials needed beyond what you already use to log in via SSH.
The one thing to remember is that git changes files with the ownership of whoever you SSH in as – so, if you want more than one person modifying that repository, have them connect as one user, or make sure their groups and umasks are right.