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
Now, you can set up an empty repository for them by running `git init` with the `--bare` option, which initializes the repository without a working directory:(((git commands, init, bare)))
Initialized empty Git repository in /opt/git/project.git/
51
51
----
52
52
53
-
Then, John, Josie, or Jessica can push the first version of their project into that repository by adding it as a remote and pushing up a branch.
54
-
Note that someone must shell onto the machine and create a bare repository every time you want to add a project.
55
-
Let's use `gitserver` as the hostname of the server on which you've set up your 'git' user and repository.
56
-
If you're running it internally, and you set up DNS for `gitserver` to point to that server, then you can use the commands pretty much as is (assuming that `myproject` is an existing project with files in it):
At this point, the others can clone it down and push changes back up just as easily:
69
+
此时,其他开发者可以克隆此仓库,并推回各自的改动,步骤很简单:
70
70
71
71
[source,console]
72
72
----
@@ -77,14 +77,15 @@ $ git commit -am 'fix for the README file'
77
77
$ git push origin master
78
78
----
79
79
80
-
With this method, you can quickly get a read/write Git server up and running for a handful of developers.
80
+
通过这种方法,你可以快速搭建一个具有读写权限、面向多个开发者的 Git 服务器。
81
81
82
-
You should note that currently all these users can also log into the server and get a shell as the ``git'' user. If you want to restrict that, you will have to change the shell to something else in the `passwd` file.
@@ -111,7 +112,7 @@ hint: ~/git-shell-commands should exist and have read and execute access.
111
112
Connection to gitserver closed.
112
113
----
113
114
114
-
Now Git network commands will still work just fine but the users won't be able to get a shell.
115
-
As the output states, you can also set up a directory in the ``git'' user's home directory that customizes the `git-shell` command a bit.
116
-
For instance, you can restrict the Git commands that the server will accept or you can customize the message that users see if they try to SSH in like that.
117
-
Run `git help shell` for more information on customizing the shell.(((git commands, help)))
0 commit comments