git - 如何在不使用终端的情况下更改现有 git 提交的作者?

标签 git github terminal command-line-interface

所以我有 2 个 GitHub 帐户(1 个工作帐户和 1 个个人帐户),并且我设置了 SSH key 以在 2 台笔记本电脑(1 个工作帐户和 1 个个人帐户)上使用。我在我的个人帐户上创建了一个存储库,并将其克隆到我的工作笔记本电脑上(确保我有正确的 SSH 链接)。但是我忘记将作者设置为我的个人帐户,因此将其设置为全局配置的我的工作帐户名称。现在我似乎无法将存储库克隆到我的个人笔记本电脑,我认为这是因为它具有我的工作帐户的提交。这是我尝试克隆它时遇到的错误:

Cloning into 'notes'...
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="83e4eaf7c3e4eaf7ebf6e1ade0ecee" rel="noreferrer noopener nofollow">[email protected]</a>: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我知道我可以使用 git commit --amend --author="John Doe <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="660c090e082602090348091401" rel="noreferrer noopener nofollow">[email protected]</a>>" 更改作者但是如果没有克隆的存储库我该怎么办?有没有办法不使用终端来做到这一点?

最佳答案

通过使用 https url 而不是 SSH 进行克隆解决了这个问题。

关于git - 如何在不使用终端的情况下更改现有 git 提交的作者?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50163915/

相关文章:

git - 我怎样才能将 merge 展平成线性历史?

git - 忽略 git 目录

git - 什么是 'temporary clone token'(在 GitHub 中)

terminal - 无法从终端使用类路径变量运行java程序

go - golang 中的终端 : syscall vs os/exec stty

xcode - 无法推送到 Git 存储库

git - 有没有办法让本地分支不可变?

git - 为什么我的 git 项目中的所有索引都发生了变化

git - 如何在不 fork 的情况下复制 gitlab/github 上的 git 存储库?

unix - 退出命令行程序的正确方法?