【问题标题】:try to change the author name in the git commit but getting an error尝试更改 git 提交中的作者姓名但收到错误
【发布时间】:2018-08-16 00:19:41
【问题描述】:

我正在尝试更改 git 提交中的作者姓名,但出现错误。我已经尝试了几件事,但我无法完成这项工作。

这是我正在尝试但得到以下错误:

git commit --amend --author=“Nik Ron <nik.ron@gmail.com>”


LM0810:Automation nik.ron$ git commit --amend --author=“Nik Ron <nik.ron@gmail.com>”
bash: nik.ron@gmail.com: No such file or directory

我正在关注本教程 - https://confluence.atlassian.com/bitbucketserverkb/how-do-you-make-changes-on-a-specific-commit-779171729.html

【问题讨论】:

  • 你能不能试着改成这样:stackoverflow.com/a/49138151/5442132 然后试着做你的提交,看看它是否有效,试试git log 看看提交作者
  • 不起作用我必须使用提交修正
  • 试试 -> git commit --amend --author="Nik Ron &lt;nik.ron@gmail.com&gt;" 您的问题可能是您用于 --author 的引号
  • 什么意思?我尝试了完全相同的事情
  • 使用--amend 时,您需要--reset-author 才能让Git 遵守--author 给定的行。

标签: git visual-studio github commit git-commit


【解决方案1】:

为了对此进行跟进,我遇到了与发帖人相同的问题,并且正如 cmets 所暗示的,问题确实是我使用的引号。来自don kon提供的例子:

git commit --amend --author=“Nik Ron <nik.ron@gmail.com>”

注意Nik Ron &lt;nik.ron@gmail.com&gt; 周围的圆角和不对称引号

“/” 引号替换为" 引号(见下文)解决了我的问题。

git commit --amend --author="Nik Ron <nik.ron@gmail.com>"

看来don kon 所遵循的教程 (here) 实际上已更新为使用不会破坏命令的引号。

【讨论】:

  • 是否有错别字 - 很难理解,谢谢
  • 感谢您的反馈!希望我的更新答案更清楚:)
猜你喜欢
  • 2018-05-29
  • 1970-01-01
  • 2021-02-08
  • 2018-11-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多