{
    "mode": "man",
    "parameter": "GITCVS-MIGRATION",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/GITCVS-MIGRATION/7/json",
    "generated": "2026-11-08T13:59:22Z",
    "synopsis": "git cvsimport *",
    "sections": {
        "NAME": {
            "content": "gitcvs-migration - Git for CVS users\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "git cvsimport *\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Git differs from CVS in that every working tree contains a repository with a full copy of the\nproject history, and no repository is inherently more important than any other. However, you\ncan emulate the CVS model by designating a single shared repository which people can\nsynchronize with; this document explains how to do that.\n\nSome basic familiarity with Git is required. Having gone through gittutorial(7) and\ngitglossary(7) should be sufficient.\n",
            "subsections": []
        },
        "DEVELOPING AGAINST A SHARED REPOSITORY": {
            "content": "Suppose a shared repository is set up in /pub/repo.git on the host foo.com. Then as an\nindividual committer you can clone the shared repository over ssh with:\n\n$ git clone foo.com:/pub/repo.git/ my-project\n$ cd my-project\n\n\nand hack away. The equivalent of cvs update is\n\n$ git pull origin\n\n\nwhich merges in any work that others might have done since the clone operation. If there are\nuncommitted changes in your working tree, commit them first before running git pull.\n\nNote\n\nThe pull command knows where to get updates from because of certain configuration\nvariables that were set by the first git clone command; see git config -l and the git-\nconfig(1) man page for details.\n\nYou can update the shared repository with your changes by first committing your changes, and\nthen using the git push command:\n\n$ git push origin master\n\n\nto \"push\" those commits to the shared repository. If someone else has updated the repository\nmore recently, git push, like cvs commit, will complain, in which case you must pull any\nchanges before attempting the push again.\n\nIn the git push command above we specify the name of the remote branch to update (master). If\nwe leave that out, git push tries to update any branches in the remote repository that have\nthe same name as a branch in the local repository. So the last push can be done with either\nof:\n\n$ git push origin\n$ git push foo.com:/pub/project.git/\n\n\nas long as the shared repository does not have any branches other than master.\n",
            "subsections": []
        },
        "SETTING UP A SHARED REPOSITORY": {
            "content": "We assume you have already created a Git repository for your project, possibly created from\nscratch or from a tarball (see gittutorial(7)), or imported from an already existing CVS\nrepository (see the next section).\n\nAssume your existing repo is at /home/alice/myproject. Create a new \"bare\" repository (a\nrepository without a working tree) and fetch your project into it:\n\n$ mkdir /pub/my-repo.git\n$ cd /pub/my-repo.git\n$ git --bare init --shared\n$ git --bare fetch /home/alice/myproject master:master\n\n\nNext, give every team member read/write access to this repository. One easy way to do this is\nto give all the team members ssh access to the machine where the repository is hosted. If you\ndon’t want to give them a full shell on the machine, there is a restricted shell which only\nallows users to do Git pushes and pulls; see git-shell(1).\n\nPut all the committers in the same group, and make the repository writable by that group:\n\n$ chgrp -R $group /pub/my-repo.git\n\n\nMake sure committers have a umask of at most 027, so that the directories they create are\nwritable and searchable by other group members.\n",
            "subsections": []
        },
        "IMPORTING A CVS ARCHIVE": {
            "content": "Note\n\nThese instructions use the git-cvsimport script which ships with git, but other importers\nmay provide better results. See the note in git-cvsimport(1) for other options.\n\nFirst, install version 2.1 or higher of cvsps from https://github.com/andreyvit/cvsps and\nmake sure it is in your path. Then cd to a checked out CVS working directory of the project\nyou are interested in and run git-cvsimport(1):\n\n$ git cvsimport -C <destination> <module>\n\n\nThis puts a Git archive of the named CVS module in the directory <destination>, which will be\ncreated if necessary.\n\nThe import checks out from CVS every revision of every file. Reportedly cvsimport can average\nsome twenty revisions per second, so for a medium-sized project this should not take more\nthan a couple of minutes. Larger projects or remote repositories may take longer.\n\nThe main trunk is stored in the Git branch named origin, and additional CVS branches are\nstored in Git branches with the same names. The most recent version of the main trunk is also\nleft checked out on the master branch, so you can start adding your own changes right away.\n\nThe import is incremental, so if you call it again next month it will fetch any CVS updates\nthat have been made in the meantime. For this to work, you must not modify the imported\nbranches; instead, create new branches for your own changes, and merge in the imported\nbranches as necessary.\n\nIf you want a shared repository, you will need to make a bare clone of the imported\ndirectory, as described above. Then treat the imported directory as another development clone\nfor purposes of merging incremental imports.\n",
            "subsections": []
        },
        "ADVANCED SHARED REPOSITORY MANAGEMENT": {
            "content": "Git allows you to specify scripts called \"hooks\" to be run at certain points. You can use\nthese, for example, to send all commits to the shared repository to a mailing list. See\ngithooks(5).\n\nYou can enforce finer grained permissions using update hooks. See Controlling access to\nbranches using update hooks[1].\n",
            "subsections": []
        },
        "PROVIDING CVS ACCESS TO A GIT REPOSITORY": {
            "content": "It is also possible to provide true CVS access to a Git repository, so that developers can\nstill use CVS; see git-cvsserver(1) for details.\n",
            "subsections": []
        },
        "ALTERNATIVE DEVELOPMENT MODELS": {
            "content": "CVS users are accustomed to giving a group of developers commit access to a common\nrepository. As we’ve seen, this is also possible with Git. However, the distributed nature of\nGit allows other development models, and you may want to first consider whether one of them\nmight be a better fit for your project.\n\nFor example, you can choose a single person to maintain the project’s primary public\nrepository. Other developers then clone this repository and each work in their own clone.\nWhen they have a series of changes that they’re happy with, they ask the maintainer to pull\nfrom the branch containing the changes. The maintainer reviews their changes and pulls them\ninto the primary repository, which other developers pull from as necessary to stay\ncoordinated. The Linux kernel and other projects use variants of this model.\n\nWith a small group, developers may just pull changes from each other’s repositories without\nthe need for a central maintainer.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "gittutorial(7), gittutorial-2(7), gitcore-tutorial(7), gitglossary(7), giteveryday(7), The\nGit User’s Manual[2]\n",
            "subsections": []
        },
        "GIT": {
            "content": "Part of the git(1) suite\n",
            "subsections": []
        },
        "NOTES": {
            "content": "1. Controlling access to branches using update hooks\nfile:///usr/share/doc/git/html/howto/update-hook-example.html\n\n2. The Git User’s Manual\nfile:///usr/share/doc/git/html/user-manual.html\n\nGit 2.43.0                                   07/02/2025                          GITCVS-MIGRATION(7)",
            "subsections": []
        }
    },
    "summary": "gitcvs-migration - Git for CVS users",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "gittutorial",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/gittutorial/7/json"
        },
        {
            "name": "gittutorial-2",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/gittutorial-2/7/json"
        },
        {
            "name": "gitcore-tutorial",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/gitcore-tutorial/7/json"
        },
        {
            "name": "gitglossary",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/gitglossary/7/json"
        },
        {
            "name": "giteveryday",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/giteveryday/7/json"
        }
    ]
}