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

标签 git

完成后

git cvsimport

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

我如何告诉 git 这些提交是我的(即定义从“user”到我的“First Lastname ”git-user 的映射)?

最佳答案

您可以使用 -A git cvsimport 的选项将 CVS 中的用户名映射到 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 会大量重写历史记录,因此如果您已经与任何人共享了存储库,则不应这样做。)

关于git - 在 cvsimport 之后告诉 git 两个用户是等价的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7713268/

相关文章:

git - 由于吊销服务器离线,吊销功能无法检查吊销

Git rebase 不会移动我们删除的文件

git - 撤消 git bisect 错误

java - jgit 存储库浏览器

git - 如何在 docker 中使用 keybase 的 git?

linux - 将 Git Push 保存到输出文件

git - 如何获取包含子模块的 Git 存储库中所有文件的绝对路径?

git - 工作前忘记 git pull 现在我不能 git push

linux - ubuntu安装gitlab失败

android - 在版本控制中存储 Android eclipse 项目?