debian-mirror-gitlab/doc/user/project/import/cvs.md

77 lines
4.2 KiB
Markdown
Raw Normal View History

2020-06-23 00:09:42 +05:30
---
type: reference, howto
stage: Manage
group: Import
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2020-06-23 00:09:42 +05:30
---
2021-09-04 01:27:46 +05:30
# Migrating from CVS **(FREE)**
2018-03-17 18:26:18 +05:30
[CVS](https://savannah.nongnu.org/projects/cvs) is an old centralized version
control system similar to [SVN](svn.md).
## CVS vs Git
The following list illustrates the main differences between CVS and Git:
- **Git is distributed.** On the other hand, CVS is centralized using a client-server
architecture. This translates to Git having a more flexible workflow since
your working area is a copy of the entire repository. This decreases the
overhead when switching branches or merging for example, since you don't have
to communicate with a remote server.
- **Atomic operations.** In Git all operations are
[atomic](https://en.wikipedia.org/wiki/Atomic_commit), either they succeed as
whole, or they fail without any changes. In CVS, commits (and other operations)
are not atomic. If an operation on the repository is interrupted in the middle,
the repository can be left in an inconsistent state.
2022-07-16 23:28:13 +05:30
- **Storage method.** Changes in CVS are per file (changeset), while in Git,
committed files are stored in their entirety (snapshot). This means it is
2018-03-17 18:26:18 +05:30
very easy in Git to revert or undo a whole change.
- **Revision IDs.** The fact that in CVS changes are per files, the revision ID
2020-11-24 15:15:51 +05:30
is depicted by version numbers, for example `1.4` reflects how many times a
2018-03-17 18:26:18 +05:30
given file has been changed. In Git, each version of a project as a whole
(each commit) has its unique name given by SHA-1.
- **Merge tracking.** Git uses a commit-before-merge approach rather than
merge-before-commit (or update-then-commit) like CVS. If while you were
preparing to create a new commit (new revision) somebody created a
new commit on the same branch and pushed to the central repository, CVS would
force you to first update your working directory and resolve conflicts before
allowing you to commit. This is not the case with Git. You first commit, save
your state in version control, then you merge the other developer's changes.
You can also ask the other developer to do the merge and resolve any conflicts
themselves.
- **Signed commits.** Git supports signing your commits with GPG for additional
security and verification that the commit indeed came from its original author.
GitLab can [integrate with GPG](../repository/gpg_signed_commits/index.md)
and show whether a signed commit is correctly verified.
_Some of the items above were taken from this great
[Stack Overflow post](https://stackoverflow.com/a/824241/974710). For a more
complete list of differences, consult the
Wikipedia article on [comparing the different version control software](https://en.wikipedia.org/wiki/Comparison_of_version_control_software)._
## Why migrate
CVS is old with no new release since 2008. Git provides more tools to work
with (`git bisect` for one) which makes for a more productive workflow.
2020-11-24 15:15:51 +05:30
Migrating to Git/GitLab will benefit you:
2018-03-17 18:26:18 +05:30
- **Shorter learning curve**, Git has a big community and a vast number of
tutorials to get you started (see our [Git topic](../../../topics/git/index.md)).
- **Integration with modern tools**, migrating to Git and GitLab you can have
an open source end-to-end software development platform with built-in version
control, issue tracking, code review, CI/CD, and more.
- **Support for many network protocols**. Git supports SSH, HTTP/HTTPS and rsync
2021-03-11 19:13:27 +05:30
among others, whereas CVS supports only SSH and its own insecure `pserver`
2018-03-17 18:26:18 +05:30
protocol with no user authentication.
## How to migrate
Here's a few links to get you started with the migration:
2021-02-22 17:27:13 +05:30
- [Migrate using the `cvs-fast-export` tool](https://gitlab.com/esr/cvs-fast-export)
2021-03-11 19:13:27 +05:30
- [Stack Overflow post on importing the CVS repository](https://stackoverflow.com/a/11490134/974710)
2022-07-23 23:45:48 +05:30
- [Convert a CVS repository to Git](https://www.techrepublic.com/article/convert-cvs-repositories-to-git/)
2019-12-21 20:55:43 +05:30
- [Man page of the `git-cvsimport` tool](https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-cvsimport.html)
2021-02-22 17:27:13 +05:30
- [Migrate using `reposurgeon`](http://www.catb.org/~esr/reposurgeon/repository-editing.html#conversion)