git - 您如何以不同的用户身份提交代码?

标签 git command-line commit

我希望能够为脚本执行此操作。我基本上是在 Git 中重新创建某些代码的整个版本历史记录——它目前使用不同的版本控制系统。我需要脚本能够将提交添加到 Git,同时保留提交的原始作者(和日期)。

假设我知道提交作者和进行更改的日期/时间,是否有 Git 命令允许我执行此操作?我假设有,因为 git-p4 做了类似的事情。我只是要求最好的方法。

最佳答案

查看 --author git commit 的选项:

来自man page :

--author=<author>

Override the commit author. Specify an explicit author using the standard A U Thor <author@example.com> format. Otherwise <author> is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=<author>); the commit author is then copied from the first such commit found.

关于git - 您如何以不同的用户身份提交代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3696938/

相关文章:

windows - WINDOWS RESTful 服务上的 cURL POST 命令行

java - 我在使用 Java 代码执行二进制可执行文件时遇到一些问题

git - 如何使用 TortoiseGit 将单个文件更改推送到两个分支?

git - Jenkins pull 请求插件触发从 repo 中的所有分支而不是特定分支构建

Perl 单行 : how to reference the filename passed in when -ne or -pe commandline switches are used

git - dokku 询问密码

GIT:每个提交的标签是唯一的吗?

PHP:我的页面需要很长时间才能加载但不会超时。一次有太多查询还是可以优化我的代码?

git - 我可以使用 `git commit` 而不是 `git cherry-pick --continue` 吗?

git - 是否有可以与 git 中的代码一起使用的验收测试管理方法?