Home Explore Blog CI



git

2nd chunk of `Documentation/gitcvs-migration.adoc`
e28378a0a436d9e0757b6813a7334139b706ef8409c765590000000100000988
 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:

------------------------------------------------
$ mkdir /pub/my-repo.git
$ cd /pub/my-repo.git
$ git --bare init --shared
$ git --bare fetch /home/alice/myproject master:master
------------------------------------------------

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 linkgit:git-shell[1].

Put all the committers in the same group, and make the repository
writable by that group:

------------------------------------------------
$ chgrp -R $group /pub/my-repo.git
------------------------------------------------

Make sure committers have a umask of at most 027, so that the directories
they create are writable and searchable by other group members.

Importing a CVS archive
-----------------------

NOTE: These instructions use the `git-cvsimport` script which ships with
git, but other importers may provide better results. See the note in
linkgit:git-cvsimport[1] for other options.

First, install version 2.1 or higher of cvsps from
https://github.com/andreyvit/cvsps[https://github.com/andreyvit/cvsps] and make
sure it is in your path.  Then cd to a checked out CVS working directory
of the project you are interested in and run linkgit:git-cvsimport[1]:

-------------------------------------------
$ git cvsimport -C <destination> <module>
-------------------------------------------

This puts a Git archive of the named CVS module in the directory
<destination>, which will be created if necessary.

The import checks out from CVS every revision of every file.  Reportedly
cvsimport can average some twenty revisions per second, so for a
medium-sized project this should not take more than a couple of minutes.
Larger projects or remote repositories may take longer.

The main trunk is stored in the Git branch named `origin`, and additional
CVS branches are stored in Git branches with the same names.  The most
recent version of the main trunk is also left checked out on the `master`
branch, so you can start adding your own changes right away.

The import

Title: Setting Up a Shared Repository and Importing from CVS
Summary
This section explains how to set up a shared Git repository, give team members access, and import a project from a CVS archive using the `git-cvsimport` script, including steps to create a bare repository, configure user permissions, and convert a CVS project into a Git archive.