今天我尝试从源存储库 ( 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 桌面)?
最佳答案
在 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/