git - 如何使用自己的身份信息进行git commit

标签 git github git-fork

今天我尝试从源存储库 ( https://github.com/donhuvy/spring-boot/ ) 同步 fork 存储库 ( https://github.com/spring-projects/spring-boot )。

cd /d Desktop
git clone https://github.com/donhuvy/spring-boot.git
cd spring-boot
git remote add upstream https://github.com/spring-projects/spring-boot.git
git fetch upstream
git checkout master
git merge upstream/master
git push

然后我在 Windows pop 的对话框中输入我的用户名、密码,稍等片刻,Git 通知成功。这是我的具体提交:https://github.com/donhuvy/spring-boot/commit/e62da83292c69aa97bbe9135ff337a11f8b87bb8

我使用 Windows 操作系统 (Git 2.8.3.windows.1) 中的 git 命令。

cmd 询问我的用户名和密码,我在将源代码推送到我自己的 fork 存储库之前输入它。但我的帐户没有显示为提交者,它显示的是计算机的名称(DCV),而不是我的名字/我的 Github 帐户(donhuvy)。我如何做我想做的事(对于 Windows GUI,我更喜欢使用命令行而不是 GitHub 桌面)?

enter image description here

enter image description here

最佳答案

在 Windows 上,您可以执行以下两种方法之一:

安装GitHub desktop并登录您的 github 帐户

git config --global user.name "<your github username>"
git config --global user.email <github email>

关于git - 如何使用自己的身份信息进行git commit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37516604/

相关文章:

azure - 由多个存储库使用的联合凭证 - Github Actions

GitHub:我们尚未找到此存储库的任何依赖项

git - 如何修复 git log 输出(更少的行丢失)?

ruby-on-rails - 使用cPanel进行版本控制和部署Rails项目

git - TFS 中是否有相当于 Cloak 的 git 版本?

git - 如何在 Git 中导入和更新 CVS 存储库?

github - 跨作业重用 github 操作的一部分

github - 如何找到已删除的要点或 GitHub 存储库的孤立分支

github - 可以在 GitHub 中自动同​​步 fork 吗?

git - 如何防止 fork 的 git repo 发散