Android Studio git 签入作者姓名
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28485686/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android Studio git check in author name
提问by Codevalley
I use Android Studio with Bitbucket(over Git) for my repositories. I generally get the author name on the revision history as my name (not my Bitbucket username). When I installed Android Studio in a new computer and pushed for the first time, it showed a dialog asking for Git Username and email. Now all my check ins have author as the username. I am not sure how to change the setting, how can I configure the VCS author settings in Android Studio?
我将 Android Studio 与 Bitbucket(通过 Git)用于我的存储库。我通常将修订历史上的作者姓名作为我的名字(不是我的 Bitbucket 用户名)。当我在新电脑上安装 Android Studio 并第一次推送时,它显示了一个对话框,要求输入 Git 用户名和电子邮件。现在我所有的签入都以作者为用户名。我不确定如何更改设置,如何在 Android Studio 中配置 VCS 作者设置?
回答by yole
I don't think there is any UI for changing this in Android Studio, but you can change this from the command line:
我认为在 Android Studio 中没有任何用于更改此设置的 UI,但您可以从命令行更改此设置:
git config user.name <your user name>
git config user.email <your email>
Add --global if you want this to apply to all Git repositories on your machine.
如果您希望这适用于您机器上的所有 Git 存储库,请添加 --global。
回答by Anand
As stated in answer above and link below we can achieve commit results but we need to use --global
如上面的回答和下面的链接所述,我们可以实现提交结果,但我们需要使用 --global
$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]
https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
回答by thekthuser
Like Martin mentioned above, running
就像上面提到的马丁一样,运行
git config user.name <your user name>
git config user.email <your email>
with or without
有还是没有
--global
did not solve this problem for me either. Where he has multiple authors that he wants to prune I couldn't get a single author on that list to be accepted, even though everything worked fine from the command line. In Android Studio I would always see
也没有为我解决这个问题。在他有多个作者想要删减的情况下,即使在命令行中一切正常,我也无法接受该列表中的单个作者。在 Android Studio 中,我总会看到
Error:No existing author found with 'username'
with no option to enter a git username or email. While not necessarily a fix, I found a way around my problem by manually doing the initial commit on the command line. After that I was able to commit from within Android Studio without any problems.
没有输入 git 用户名或电子邮件的选项。虽然不一定是修复,但我通过在命令行上手动执行初始提交找到了解决问题的方法。之后,我可以在 Android Studio 中进行提交,没有任何问题。
回答by Hossin Asaadi
i has same problem. you just need to change your name in Bitbucket or gitlab to name you enter in author. good luck
我有同样的问题。你只需要在 Bitbucket 或 gitlab 中更改你的名字来命名你在作者中输入的名字。祝你好运
回答by Brendan
This worked for me when prompted for Author on Android Studio -
当提示在 Android Studio 上输入 Author 时,这对我有用 -
your git username <your git primary email>