告诉git cvsimport后两个用户是等价的

时间:2011-10-10 13:12:27

标签: git

完成

之后
git cvsimport

我以前的提交列出属于用户“user”(用户是我的unix用户名)。

我如何告诉git这些提交是我的(即,定义从“user”到我的“First Lastname< first@last.com>”git-user)的映射?

1 个答案:

答案 0 :(得分:8)

您可以使用-A git cvsimport选项将CVS中的用户名映射到git中的Full Name <email@address>。该手册页说:

   -A <author-conv-file>
       CVS by default uses the Unix username when writing its
       commit logs. Using this option and an author-conv-file in
       this format

                   exon=Andreas Ericsson <ae@op5.se>
                   spawn=Simon Pawn <spawn@frog-pond.org>

       git cvsimport will make it appear as those authors had
       their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
       all along.

       For convenience, this data is saved to
       $GIT_DIR/cvs-authors each time the -A option is provided
       and read from that same file each time git cvsimport is
       run.

       It is not recommended to use this feature if you intend to
       export changes back to CVS again later with git
       cvsexportcommit.

如果您不想重新运行导入,可以查看this answer,它会告诉您如何使用git filter-branch在每次提交中重写作者信息。 (请注意,使用git filter-branch进行广泛的重写,因此如果您已经与任何人共享了存储库,则不应该这样做。)