git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] Documentation: enhanced "git for CVS users" doc about shared repositories
@ 2007-11-05 22:32 Francesco Pretto
  2007-11-05 23:52 ` Junio C Hamano
  0 siblings, 1 reply; 18+ messages in thread
From: Francesco Pretto @ 2007-11-05 22:32 UTC (permalink / raw)
  To: git

More detailed instructions on how to set up shared repositories.
Added a reference to "git for CVS users" doc in git-init manual.

Signed-off-by: Francesco Pretto <ceztkoml@gmail.com>
---
 Documentation/cvs-migration.txt |   72 ++++++++++++++++++++++++++++++--------
 Documentation/git-init.txt      |    7 ++++
 2 files changed, 64 insertions(+), 15 deletions(-)

diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
index 3b6b494..c92ed49 100644
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -13,12 +13,12 @@ link:tutorial.html[tutorial introduction to git] should be sufficient.
 Developing against a shared repository
 --------------------------------------
 
-Suppose a shared repository is set up in /pub/repo.git on the host
+Suppose a shared repository is set up in /pub/scm/repo.git on the host
 foo.com.  Then as an individual committer you can clone the shared
 repository over ssh with:
 
 ------------------------------------------------
-$ git clone foo.com:/pub/repo.git/ my-project
+$ git clone foo.com:/pub/scm/repo.git/ my-project
 $ cd my-project
 ------------------------------------------------
 
@@ -68,37 +68,79 @@ other than `master`.
 Setting Up a Shared Repository
 ------------------------------
 
-We assume you have already created a git repository for your project,
-possibly created from scratch or from a tarball (see the
-link:tutorial.html[tutorial]), or imported from an already existing CVS
-repository (see the next section).
+We assume you have admin privilege on the remote machine. Moreover, we assume
+you have already created a git repository for your project, possibly created
+from scratch or from a tarball (see the link:tutorial.html[tutorial]),or
+imported  from an already existing CVS repository (see the next section).
 
-Assume your existing repo is at /home/alice/myproject.  Create a new "bare"
-repository (a repository without a working tree) and fetch your project into
-it:
+First, let's create a common directory for all the projects you'll want to
+track with git:
+
+-----------------------------------------------
+$ mkdir -p /pub/scm
+-----------------------------------------------
+
+It's recommended, but not necessary, to create a specific group of commiters
+for every project/repository. With root credentials launch:
+
+------------------------------------------------
+$ groupadd $group
+------------------------------------------------
+
+Assume your existing repository is at /home/alice/myproject.  Create a new
+"bare" repository (a repository without a working tree) and fetch your project
+into it:
 
 ------------------------------------------------
-$ mkdir /pub/my-repo.git
+$ mkdir /pub/scm/my-repo.git
 $ cd /pub/my-repo.git
 $ git --bare init --shared
 $ git --bare fetch /home/alice/myproject master:master
 ------------------------------------------------
 
+Now, set the group ownership of the git repository you've just created to the
+same group of the commiters:
+
+------------------------------------------------
+$ chgrp -R $group /pub/scm/my-repo.git
+------------------------------------------------
+
 Next, give every team member read/write access to this repository.  One
 easy way to do this is to give all the team members ssh access to the
 machine where the repository is hosted.  If you don't want to give them a
 full shell on the machine, there is a restricted shell which only allows
 users to do git pushes and pulls; see gitlink:git-shell[1].
 
-Put all the committers in the same group, and make the repository
-writable by that group:
+First, enable it putting on the trusted shells list of the system:
+
+------------------------------------------------
+$ echo `which git-shell` >> /etc/shells
+------------------------------------------------
+
+Ensure users will not have write permission on /pub/scm. Now, let's create
+them with the following command launched with root credentials:
 
 ------------------------------------------------
-$ chgrp -R $group /pub/my-repo.git
+$ useradd -g $group -d /pub/scm -s `which git-shell` $username
 ------------------------------------------------
 
-Make sure committers have a umask of at most 027, so that the directories
-they create are writable and searchable by other group members.
+They will be enabled to push on repositories owned by the group $group.
+Later, you can give users access to other projects simply by adding them to
+other groups.
+
+[NOTE]
+================================
+With previous versions of git, it could be necessary to set umask variable of
+all commiters with values like 002 or 007. If you still need to support them,
+you can do it in the following way; assuming that all users have their home
+positionated at /pub/scm, like in the previous example, launch the command:
+
+------------------------------------------------
+$ echo "umask 022" >> /pub/scm/.profile
+------------------------------------------------
+
+At the next login, users will have their umask variable automatically set.
+================================
 
 Importing a CVS archive
 -----------------------
diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index 07484a4..f5f363d 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -101,6 +101,13 @@ $ git-add .     <2>
 <2> add all existing file to the index
 
 
+SHARED REPOSITORIES
+-------------------
+
+Please refer to link:cvs-migration.html[git for CVS users], section "Setting Up
+a Shared Repository", for details on how to set up shared repositories.
+
+
 Author
 ------
 Written by Linus Torvalds <torvalds@osdl.org>

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-11-07 17:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-05 22:32 [Patch] Documentation: enhanced "git for CVS users" doc about shared repositories Francesco Pretto
2007-11-05 23:52 ` Junio C Hamano
2007-11-06 10:04   ` Francesco Pretto
2007-11-06 10:53     ` Johannes Schindelin
2007-11-06 11:14       ` Francesco Pretto
2007-11-06 21:44   ` [PATCH] " Francesco Pretto
2007-11-06 23:25     ` Junio C Hamano
2007-11-07  0:46       ` Francesco Pretto
2007-11-07  0:55         ` Johannes Schindelin
2007-11-07  1:10           ` Francesco Pretto
2007-11-07  1:36           ` Aghiles
2007-11-07  7:35             ` Steffen Prohaska
2007-11-07  8:45               ` Andreas Ericsson
2007-11-07  9:09           ` David Kastrup
2007-11-07 17:32           ` J. Bruce Fields
2007-11-07  8:03         ` Wincent Colaiuta
2007-11-07  8:07         ` Steffen Prohaska
2007-11-07 16:47           ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).