forked from progit/progit2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request progit#567 from YueLinHo/i312
Fix issue progit#312: /srv/git instead of /opt/git for server repositories
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,29 +37,29 @@ It takes the Git repository by itself, without a working directory, and creates | |
==== Putting the Bare Repository on a Server | ||
|
||
Now that you have a bare copy of your repository, all you need to do is put it on a server and set up your protocols. | ||
Let's say you've set up a server called `git.example.com` that you have SSH access to, and you want to store all your Git repositories under the `/opt/git` directory. | ||
Assuming that `/opt/git` exists on that server, you can set up your new repository by copying your bare repository over: | ||
Let's say you've set up a server called `git.example.com` that you have SSH access to, and you want to store all your Git repositories under the `/srv/git` directory. | ||
Assuming that `/srv/git` exists on that server, you can set up your new repository by copying your bare repository over: | ||
|
||
[source,console] | ||
---- | ||
$ scp -r my_project.git [email protected]:/opt/git | ||
$ scp -r my_project.git [email protected]:/srv/git | ||
---- | ||
|
||
At this point, other users who have SSH access to the same server which has read-access to the `/opt/git` directory can clone your repository by running | ||
At this point, other users who have SSH access to the same server which has read-access to the `/srv/git` directory can clone your repository by running | ||
|
||
[source,console] | ||
---- | ||
$ git clone [email protected]:/opt/git/my_project.git | ||
$ git clone [email protected]:/srv/git/my_project.git | ||
---- | ||
|
||
If a user SSHs into a server and has write access to the `/opt/git/my_project.git` directory, they will also automatically have push access. | ||
If a user SSHs into a server and has write access to the `/srv/git/my_project.git` directory, they will also automatically have push access. | ||
|
||
Git will automatically add group write permissions to a repository properly if you run the `git init` command with the `--shared` option.(((git commands, init, bare))) | ||
|
||
[source,console] | ||
---- | ||
$ ssh [email protected] | ||
$ cd /opt/git/my_project.git | ||
$ cd /srv/git/my_project.git | ||
$ git init --bare --shared | ||
---- | ||
|
||
|