git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Patch] Documentation: enhanced "git for CVS users" doc about shared repositories

From
FPFrancesco Pretto <ceztkoml@gmail.com>
Date
Nov 5, 2007, 22:32 UTC
Message-ID
<472F99F8.4010904@gmail.com>

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>
Next: Junio C Hamano
Message 1 of 18 in “Documentation: enhanced "git for CVS users" doc about shared repositories”
  1. Documentation: enhanced "git for CVS users" doc about shared repositoriesFrancesco Pretto, Nov 5, 2007
  2. Junio C HamanoNov 5, 2007
  3. Francesco PrettoNov 6, 2007
  4. Johannes SchindelinNov 6, 2007
  5. Francesco PrettoNov 6, 2007
  6. Francesco PrettoNov 6, 2007
  7. Junio C HamanoNov 6, 2007
  8. Francesco PrettoNov 7, 2007
  9. Johannes SchindelinNov 7, 2007
  10. Francesco PrettoNov 7, 2007
  11. AghilesNov 7, 2007
  12. Steffen ProhaskaNov 7, 2007
  13. Andreas EricssonNov 7, 2007
  14. David KastrupNov 7, 2007
  15. J. Bruce FieldsNov 7, 2007
  16. Wincent ColaiutaNov 7, 2007
  17. Steffen ProhaskaNov 7, 2007
  18. J. Bruce FieldsNov 7, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.