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

thi*_*ias 4 git

做完之后

git cvsimport
Run Code Online (Sandbox Code Playgroud)

我以前的提交列出属于用户"user"(用户是我的unix用户名).

我怎么能告诉git这些提交是我的(即,定义从"user"到我的"First Lastname <first@last.com>"git-user的映射?

Mar*_*air 8

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

   -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.
Run Code Online (Sandbox Code Playgroud)

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