Skip to content

Commit f01f815

Browse files
moygitster
authored andcommitted
Document that WebDAV doesn't need git on the server, and works over SSL
I managed to set up a Git repository on a preconfigured WebDAV server, and using HTTPS, without installing Git on it or changing the server configuration. This works through a proxy too. This patch reflects this (it previously stated that Git was _necessary_ on the server, which isn't true). Also give a few hints to troubleshoting. Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4c414e2 commit f01f815

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

Documentation/howto/setup-git-server-over-http.txt

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
From: Rutger Nijlunsing <[email protected]>
2-
Subject: Setting up a git repository which can be pushed into and pulled from over HTTP.
2+
Subject: Setting up a git repository which can be pushed into and pulled from over HTTP(S).
33
Date: Thu, 10 Aug 2006 22:00:26 +0200
44

55
Since Apache is one of those packages people like to compile
@@ -40,19 +40,23 @@ What's needed:
4040

4141
- have permissions to chown a directory
4242

43-
- have git installed at the server _and_ client
43+
- have git installed on the client, and
4444

45-
In effect, this probably means you're going to be root.
45+
- either have git installed on the server or have a webdav client on
46+
the client.
47+
48+
In effect, this means you're going to be root, or that you're using a
49+
preconfigured WebDAV server.
4650

4751

4852
Step 1: setup a bare GIT repository
4953
-----------------------------------
5054

5155
At the time of writing, git-http-push cannot remotely create a GIT
5256
repository. So we have to do that at the server side with git. Another
53-
option would be to generate an empty repository at the client and copy
54-
it to the server with WebDAV. But then you're probably the first to
55-
try that out :)
57+
option is to generate an empty bare repository at the client and copy
58+
it to the server with a WebDAV client (which is the only option if Git
59+
is not installed on the server).
5660

5761
Create the directory under the DocumentRoot of the directories served
5862
by Apache. As an example we take /usr/local/apache2, but try "grep
@@ -169,7 +173,9 @@ On Debian:
169173

170174
Most tests should pass.
171175

172-
A command line tool to test WebDAV is cadaver.
176+
A command line tool to test WebDAV is cadaver. If you prefer GUIs, for
177+
example, konqueror can open WebDAV URLs as "webdav://..." or
178+
"webdavs://...".
173179

174180
If you're into Windows, from XP onwards Internet Explorer supports
175181
WebDAV. For this, do Internet Explorer -> Open Location ->
@@ -179,8 +185,9 @@ http://<servername>/my-new-repo.git [x] Open as webfolder -> login .
179185
Step 3: setup the client
180186
------------------------
181187

182-
Make sure that you have HTTP support, i.e. your git was built with curl.
183-
The easiest way to check is to look for the executable 'git-http-push'.
188+
Make sure that you have HTTP support, i.e. your git was built with
189+
curl (version more recent than 7.10). The command 'git http-push' with
190+
no argument should display a usage message.
184191

185192
Then, add the following to your $HOME/.netrc (you can do without, but will be
186193
asked to input your password a _lot_ of times):
@@ -197,10 +204,10 @@ instead of the server name.
197204

198205
To check whether all is OK, do:
199206

200-
curl --netrc --location -v http://<username>@<servername>/my-new-repo.git/
201-
202-
...this should give a directory listing in HTML of /var/www/my-new-repo.git .
207+
curl --netrc --location -v http://<username>@<servername>/my-new-repo.git/HEAD
203208

209+
...this should give something like 'ref: refs/heads/master', which is
210+
the content of the file HEAD on the server.
204211

205212
Now, add the remote in your existing repository which contains the project
206213
you want to export:
@@ -225,6 +232,15 @@ want to export) to repository called 'upload', which we previously
225232
defined with git-config.
226233

227234

235+
Using a proxy:
236+
--------------
237+
238+
If you have to access the WebDAV server from behind an HTTP(S) proxy,
239+
set the variable 'all_proxy' to 'http://proxy-host.com:port', or
240+
'http://login-on-proxy:[email protected]:port'. See 'man
241+
curl' for details.
242+
243+
228244
Troubleshooting:
229245
----------------
230246

@@ -248,9 +264,14 @@ Reading /usr/local/apache2/logs/error_log is often helpful.
248264

249265
On Debian: Read /var/log/apache2/error.log instead.
250266

267+
If you access HTTPS locations, git may fail verifying the SSL
268+
certificate (this is return code 60). Setting http.sslVerify=false can
269+
help diagnosing the problem, but removes security checks.
270+
251271

252272
Debian References: http://www.debian-administration.org/articles/285
253273

254274
Authors
255275
Johannes Schindelin <[email protected]>
256276
Rutger Nijlunsing <[email protected]>
277+
Matthieu Moy <[email protected]>

0 commit comments

Comments
 (0)