GITCVS-MIGRATION(7)
β¨ GITCVS-MIGRATION(7) β¨
okay so this is the gitcvs-migration page from the Git Manual β it's the one that holds your hand while you drag your whole CVS life into Git π lowkey a glow-up arc.
πΈ NAME πΈ
gitcvs-migration β Git, but for CVS girlies π«Ά
π¦ SYNOPSIS π¦
git cvsimport *
π DESCRIPTION π
So here's the tea: Git is not like CVS, and the way it's different is kind of the whole point. In Git, every working tree contains a repository with a full copy of the project history, and literally no repository is inherently more important than any other. Nobody's the main character repo. Everyone has the whole story π
BUT β and this is the slay part β you can emulate the CVS model by designating one single shared repository that people can synchronize with. That's exactly what this doc explains how to do, step by step, no cap β¨
You do need some basic familiarity with Git first, bestie. Having gone through gittutorial(7) and gitglossary(7) should be sufficient β like, that's the prerequisite homework and then you're good π
π DEVELOPING AGAINST A SHARED REPOSITORY π
Say a shared repository is set up in /pub/repo.git on the host foo.com. As an individual committer, you clone that shared repository over ssh like this:
$ git clone foo.com:/pub/repo.git/ my-project
$ cd my-project
and then you just... hack away π»β¨ The equivalent of cvs update is:
$ git pull origin
which merges in any work that others might have done since the clone operation. Iconic. But listen β if there are uncommitted changes in your working tree, commit them first before running git pull. Don't be messy π
Note π Thepullcommand knows where to get updates from because of certain configuration variables that were set by the firstgit clonecommand; see the subcommand list ingit-config(1)for details. iykyk.
You can update the shared repository with your changes by first committing your changes, and then using the git push command:
$ git push origin master
to "push" those commits to the shared repository. And if someone else has updated the repository more recently, git push, like cvs commit, will complain β in which case you must pull any changes before attempting the push again. it's giving "wait your turn" energy fr fr π€
In the git push command above we specify the name of the remote branch to update (master). If we leave that out, git push tries to update any branches in the remote repository that have the same name as a branch in the local repository. So the last push can be done with either of:
$ git push origin
$ git push foo.com:/pub/project.git/
as long as the shared repository does not have any branches other than master. Periodt π
π§ 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 gittutorial(7)), 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:
$ 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 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. tiny detail, huge consequences, we love her πΈ
π IMPORTING A CVS ARCHIVE π
Note β οΈ These instructions use thegit-cvsimportscript which ships with git, but other importers may provide better results. See the note ingit-cvsimport(1)for other options. shop around bestie!
First, install version 2.1 or higher of cvsps from 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 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. no need to pre-make it, she's self-sufficient π
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. grab a snack π
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. instant gratification, we love to see it β¨
The import is incremental, so if you call it again next month it will fetch any CVS updates that have been made in the meantime. For this to work, you must not modify the imported branches β instead, create new branches for your own changes, and merge in the imported branches as necessary. do not touch the sacred branches bestie π
If you want a shared repository, you will need to make a bare clone of the imported directory, as described above. Then treat the imported directory as another development clone for purposes of merging incremental imports. it's clones all the way down π
π₯ ADVANCED SHARED REPOSITORY MANAGEMENT π₯
Git allows you to specify scripts called "hooks" to be run at certain points. You can use these, for example, to send all commits to the shared repository to a mailing list. See githooks(5) π¬
You can enforce finer grained permissions using update hooks. See Controlling access to branches using update hooks[1]. big brain security moves π
π¦ PROVIDING CVS ACCESS TO A GIT REPOSITORY π¦
It is also possible to provide true CVS access to a Git repository, so that developers can still use CVS; see git-cvsserver(1) for details. like yes queen, keep your old workflow, nobody's forcing you π
β ALTERNATIVE DEVELOPMENT MODELS β
CVS users are accustomed to giving a group of developers commit access to a common repository. As we've seen, this is also possible with Git. However, the distributed nature of Git allows other development models, and you may want to first consider whether one of them might be a better fit for your project. vibe check your workflow first π«
For example, you can choose a single person to maintain the project's primary public repository. Other developers then clone this repository and each work in their own clone. When they have a series of changes that they're happy with, they ask the maintainer to pull from the branch containing the changes. The maintainer reviews their changes and pulls them into the primary repository, which other developers pull from as necessary to stay coordinated. The Linux kernel and other projects use variants of this model. maintainer = main character energy fr π
With a small group, developers may just pull changes from each other's repositories without the need for a central maintainer. no boss, just besties pulling from each other π«Ά
π SEE ALSO π
gittutorial(7), gittutorial-2(7), gitcore-tutorial(7), gitglossary(7), giteveryday(7), The Git User's Manual[2]
πΈ GIT πΈ
Part of the git(1) suite π
π NOTES π
- Controlling access to branches using update hooks
file:///usr/share/doc/git-doc/howto/update-hook-example.html - The Git User's Manual
file:///usr/share/doc/git-doc/user-manual.html
okay that's the whole page bestie, go forth and migrate β¨π¦π
Git 2.56.0 Β· 2026-09-27 Β· GITCVS-MIGRATION(7) β that's a wrap, ily, now go git push something ππ
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms