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