git - 获取 git 用户名以链接到个人资料

标签 git github

当用户提交到存储库时,我通常会看到

“git commit message”[用户名]

[用户名] 通常链接到该人的 github 个人资料

当我这样做时,我的用户名就是我在计算机上的用户名。

如何让它成为我的 github 用户名。

最佳答案

您需要correctly setup your Git configuration因此电子邮件与与您的 GitHub 帐户关联的电子邮件相匹配:

Set your username and email. Git tracks who makes each commit by checking the user’s name and email. In addition, we use this info to associate your commits with your GitHub account. To set these, enter the code below, replacing the name and email with your own. The name should be your actual name, not your GitHub username.

$ git config --global user.name "Firstname Lastname"
$ git config --global user.email "your_email@youremail.com"

关于git - 获取 git 用户名以链接到个人资料,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9287911/

相关文章:

git - 分支名称不符合git标准:refs/heads/master

git - 在git代理密码中转义@字符

git - 如何在 git 中标记你的分支未解决?

git - 不要删除 git 提交消息中的空格

git - 对裸存储库的 SmartGit 身份验证失败,而从命令行推送有效

git - 将 Bitbucket 转换为 Github

java - Travis-CI可以自动生成并推送JavaDoc吗?

git - 只取一部分git commit,push到github

git - 如何清理git存储库中损坏的对象?

git 工作树与 "clone --reference"