Documentation / git-cvsimport.txton commit Merge branch 'jk/pretty-G-format-fixes' (ce8350f)
   1git-cvsimport(1)
   2================
   3
   4NAME
   5----
   6git-cvsimport - Salvage your data out of another SCM people love to hate
   7
   8
   9SYNOPSIS
  10--------
  11[verse]
  12'git cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]
  13              [-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>]
  14              [-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]
  15              [-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>]
  16              [-r <remote>] [-R] [<CVS_module>]
  17
  18
  19DESCRIPTION
  20-----------
  21*WARNING:* `git cvsimport` uses cvsps version 2, which is considered
  22deprecated; it does not work with cvsps version 3 and later.  If you are
  23performing a one-shot import of a CVS repository consider using
  24http://cvs2svn.tigris.org/cvs2git.html[cvs2git] or
  25https://github.com/BartMassey/parsecvs[parsecvs].
  26
  27Imports a CVS repository into Git. It will either create a new
  28repository, or incrementally import into an existing one.
  29
  30Splitting the CVS log into patch sets is done by 'cvsps'.
  31At least version 2.1 is required.
  32
  33*WARNING:* for certain situations the import leads to incorrect results.
  34Please see the section <<issues,ISSUES>> for further reference.
  35
  36You should *never* do any work of your own on the branches that are
  37created by 'git cvsimport'.  By default initial import will create and populate a
  38"master" branch from the CVS repository's main branch which you're free
  39to work with; after that, you need to 'git merge' incremental imports, or
  40any CVS branches, yourself.  It is advisable to specify a named remote via
  41-r to separate and protect the incoming branches.
  42
  43If you intend to set up a shared public repository that all developers can
  44read/write, or if you want to use linkgit:git-cvsserver[1], then you
  45probably want to make a bare clone of the imported repository,
  46and use the clone as the shared repository.
  47See linkgit:gitcvs-migration[7].
  48
  49
  50OPTIONS
  51-------
  52-v::
  53        Verbosity: let 'cvsimport' report what it is doing.
  54
  55-d <CVSROOT>::
  56        The root of the CVS archive. May be local (a simple path) or remote;
  57        currently, only the :local:, :ext: and :pserver: access methods
  58        are supported. If not given, 'git cvsimport' will try to read it
  59        from `CVS/Root`. If no such file exists, it checks for the
  60        `CVSROOT` environment variable.
  61
  62<CVS_module>::
  63        The CVS module you want to import. Relative to <CVSROOT>.
  64        If not given, 'git cvsimport' tries to read it from
  65        `CVS/Repository`.
  66
  67-C <target-dir>::
  68        The Git repository to import to.  If the directory doesn't
  69        exist, it will be created.  Default is the current directory.
  70
  71-r <remote>::
  72        The Git remote to import this CVS repository into.
  73        Moves all CVS branches into remotes/<remote>/<branch>
  74        akin to the way 'git clone' uses 'origin' by default.
  75
  76-o <branch-for-HEAD>::
  77        When no remote is specified (via -r) the 'HEAD' branch
  78        from CVS is imported to the 'origin' branch within the Git
  79        repository, as 'HEAD' already has a special meaning for Git.
  80        When a remote is specified the 'HEAD' branch is named
  81        remotes/<remote>/master mirroring 'git clone' behaviour.
  82        Use this option if you want to import into a different
  83        branch.
  84+
  85Use '-o master' for continuing an import that was initially done by
  86the old cvs2git tool.
  87
  88-i::
  89        Import-only: don't perform a checkout after importing.  This option
  90        ensures the working directory and index remain untouched and will
  91        not create them if they do not exist.
  92
  93-k::
  94        Kill keywords: will extract files with '-kk' from the CVS archive
  95        to avoid noisy changesets. Highly recommended, but off by default
  96        to preserve compatibility with early imported trees.
  97
  98-u::
  99        Convert underscores in tag and branch names to dots.
 100
 101-s <subst>::
 102        Substitute the character "/" in branch names with <subst>
 103
 104-p <options-for-cvsps>::
 105        Additional options for cvsps.
 106        The options '-u' and '-A' are implicit and should not be used here.
 107+
 108If you need to pass multiple options, separate them with a comma.
 109
 110-z <fuzz>::
 111        Pass the timestamp fuzz factor to cvsps, in seconds. If unset,
 112        cvsps defaults to 300s.
 113
 114-P <cvsps-output-file>::
 115        Instead of calling cvsps, read the provided cvsps output file. Useful
 116        for debugging or when cvsps is being handled outside cvsimport.
 117
 118-m::
 119        Attempt to detect merges based on the commit message. This option
 120        will enable default regexes that try to capture the source
 121        branch name from the commit message.
 122
 123-M <regex>::
 124        Attempt to detect merges based on the commit message with a custom
 125        regex. It can be used with '-m' to enable the default regexes
 126        as well. You must escape forward slashes.
 127+
 128The regex must capture the source branch name in $1.
 129+
 130This option can be used several times to provide several detection regexes.
 131
 132-S <regex>::
 133        Skip paths matching the regex.
 134
 135-a::
 136        Import all commits, including recent ones. cvsimport by default
 137        skips commits that have a timestamp less than 10 minutes ago.
 138
 139-L <limit>::
 140        Limit the number of commits imported. Workaround for cases where
 141        cvsimport leaks memory.
 142
 143-A <author-conv-file>::
 144        CVS by default uses the Unix username when writing its
 145        commit logs. Using this option and an author-conv-file
 146        maps the name recorded in CVS to author name, e-mail and
 147        optional time zone:
 148+
 149---------
 150        exon=Andreas Ericsson <ae@op5.se>
 151        spawn=Simon Pawn <spawn@frog-pond.org> America/Chicago
 152
 153---------
 154+
 155'git cvsimport' will make it appear as those authors had
 156their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
 157all along.  If a time zone is specified, GIT_AUTHOR_DATE will
 158have the corresponding offset applied.
 159+
 160For convenience, this data is saved to `$GIT_DIR/cvs-authors`
 161each time the '-A' option is provided and read from that same
 162file each time 'git cvsimport' is run.
 163+
 164It is not recommended to use this feature if you intend to
 165export changes back to CVS again later with
 166'git cvsexportcommit'.
 167
 168-R::
 169        Generate a `$GIT_DIR/cvs-revisions` file containing a mapping from CVS
 170        revision numbers to newly-created Git commit IDs.  The generated file
 171        will contain one line for each (filename, revision) pair imported;
 172        each line will look like
 173+
 174---------
 175src/widget.c 1.1 1d862f173cdc7325b6fa6d2ae1cfd61fd1b512b7
 176---------
 177+
 178The revision data is appended to the file if it already exists, for use when
 179doing incremental imports.
 180+
 181This option may be useful if you have CVS revision numbers stored in commit
 182messages, bug-tracking systems, email archives, and the like.
 183
 184-h::
 185        Print a short usage message and exit.
 186
 187OUTPUT
 188------
 189If '-v' is specified, the script reports what it is doing.
 190
 191Otherwise, success is indicated the Unix way, i.e. by simply exiting with
 192a zero exit status.
 193
 194[[issues]]
 195ISSUES
 196------
 197Problems related to timestamps:
 198
 199 * If timestamps of commits in the CVS repository are not stable enough
 200   to be used for ordering commits changes may show up in the wrong
 201   order.
 202 * If any files were ever "cvs import"ed more than once (e.g., import of
 203   more than one vendor release) the HEAD contains the wrong content.
 204 * If the timestamp order of different files cross the revision order
 205   within the commit matching time window the order of commits may be
 206   wrong.
 207
 208Problems related to branches:
 209
 210 * Branches on which no commits have been made are not imported.
 211 * All files from the branching point are added to a branch even if
 212   never added in CVS.
 213 * This applies to files added to the source branch *after* a daughter
 214   branch was created: if previously no commit was made on the daughter
 215   branch they will erroneously be added to the daughter branch in git.
 216
 217Problems related to tags:
 218
 219* Multiple tags on the same revision are not imported.
 220
 221If you suspect that any of these issues may apply to the repository you
 222want to imort, consider using cvs2git:
 223
 224* cvs2git (part of cvs2svn), `http://subversion.apache.org/`
 225
 226GIT
 227---
 228Part of the linkgit:git[1] suite