You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/04-git-server/sections/git-daemon.asc
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
=== Git Daemon
2
2
3
3
(((serving repositories, git protocol)))
4
-
Next we'll set up a daemon serving repositories over the ``Git'' protocol.
5
-
This is common choice for fast, unauthenticated access to your Git data.
6
-
Remember that since it's not an authenticated service, anything you serve over this protocol is public within its network.
4
+
Next we'll set up a daemon serving repositories using the ``Git'' protocol.
5
+
This is a common choice for fast, unauthenticated access to your Git data.
6
+
Remember that since this is not an authenticated service, anything you serve over this protocol is public within its network.
7
7
8
-
If you're running this on a server outside your firewall, it should only be used for projects that are publicly visible to the world.
8
+
If you're running this on a server outside your firewall, it should be used only for projects that are publicly visible to the world.
9
9
If the server you're running it on is inside your firewall, you might use it for projects that a large number of people or computers (continuous integration or build servers) have read-only access to, when you don't want to have to add an SSH key for each.
10
10
11
11
In any case, the Git protocol is relatively easy to set up.
@@ -16,7 +16,7 @@ Basically, you need to run this command in a daemonized manner:(((git commands,
`--reuseaddr` allows the server to restart without waiting for old connections to time out, the `--base-path` option allows people to clone projects without specifying the entire path, and the path at the end tells the Git daemon where to look for repositories to export.
19
+
The `--reuseaddr`option allows the server to restart without waiting for old connections to time out, while the `--base-path` option allows people to clone projects without specifying the entire path, and the path at the end tells the Git daemon where to look for repositories to export.
20
20
If you're running a firewall, you'll also need to punch a hole in it at port 9418 on the box you're setting this up on.
21
21
22
22
You can daemonize this process a number of ways, depending on the operating system you're running.
@@ -50,7 +50,7 @@ You might have noticed that Git daemon is started here with `git` as both group
50
50
51
51
Modify it to fit your needs and make sure provided user exists on the system.
52
52
53
-
Finally, you'll run `systemctl enable git-daemon` to automatically start the service on boot, and the usual service commands like `service start` and `service stop` are instantly available.
53
+
Finally, you'll run `systemctl enable git-daemon` to automatically start the service on boot, and can start and stop the service with, respectively, `systemctl start git-daemon` and `systemctl stop git-daemon`.
54
54
55
55
Until LTS 14.04, Ubuntu used upstart service unit configuration.
56
56
Therefore, on Ubuntu <= 14.04 you can use an Upstart script.
@@ -75,7 +75,7 @@ exec /usr/bin/git daemon \
75
75
respawn
76
76
----
77
77
78
-
For security reasons, it is strongly encouraged to have this daemon run as a user with read-only permissions to the repositories – you can easily do this by creating a new user 'git-ro' and running the daemon as them.
78
+
For security reasons, it is strongly encouraged to have this daemon run as a user with read-only permissions to the repositories -- you can easily do this by creating a new user 'git-ro' and running the daemon as them.
79
79
For the sake of simplicity we'll simply run it as the same 'git' user that `git-shell` is running as.
80
80
81
81
When you restart your machine, your Git daemon will start automatically and respawn if it goes down.
@@ -86,7 +86,7 @@ To get it running without having to reboot, you can run this:
86
86
$ initctl start local-git-daemon
87
87
----
88
88
89
-
On other systems, you may want to use `xinetd`, a script in your `sysvinit` system, or something else – as long as you get that command daemonized and watched somehow.
89
+
On other systems, you may want to use `xinetd`, a script in your `sysvinit` system, or something else -- as long as you get that command daemonized and watched somehow.
90
90
91
91
Next, you have to tell Git which repositories to allow unauthenticated Git server-based access to.
92
92
You can do this in each repository by creating a file named `git-daemon-export-ok`.
0 commit comments