Android Studio git检入作者姓名

Cod*_*ley 25 git version-control intellij-idea android-studio

我使用Android Studio和Bitbucket(通过Git)作为我的存储库.我通常会将修订历史记录中的作者姓名作为我的名字(而不是我的Bitbucket用户名).当我在新计算机上安装Android Studio并第一次推送时,它显示了一个询问Git用户名和电子邮件的对话框.现在我所有的支票都有作者的用户名.我不确定如何更改设置,如何在Android Studio中配置VCS作者设置?

yol*_*ole 47

我不认为在Android Studio中有任何用于更改此功能的UI,但您可以从命令行更改此设置:

git config user.name <your user name>
git config user.email <your email>
Run Code Online (Sandbox Code Playgroud)

如果要将此应用于计算机上的所有Git存储库,请添加--global.


小智 12

如上面的答案和下面的链接所述,我们可以实现提交结果,但我们需要使用 --global

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
Run Code Online (Sandbox Code Playgroud)

https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup


the*_*ser 5

就像上面提到的马丁一样,运行

git config user.name <your user name>
git config user.email <your email>
Run Code Online (Sandbox Code Playgroud)

有还是没有

--global
Run Code Online (Sandbox Code Playgroud)

也没有为我解决这个问题。在他有多个作者想要删减的情况下,即使在命令行中一切正常,我也无法接受该列表中的单个作者。在 Android Studio 中,我总会看到

Error:No existing author found with 'username'
Run Code Online (Sandbox Code Playgroud)

没有输入 git 用户名或电子邮件的选项。虽然不一定是修复,但我通过在命令行上手动执行初始提交找到了解决问题的方法。之后,我可以在 Android Studio 中进行提交,没有任何问题。