设置Git用户名 [英] Setting up Git User Name

查看:87
本文介绍了设置Git用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照说明在以下位置设置Git https://git-scm.com/book/en/v2/入门-首次Git设置

I’m following the instructions to setup Git at https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup

文档指出要从命令行运行以下命令:

The document states to run the following from the command line:

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

当我使用前面的$符号运行这些命令时,会收到此错误:

When I run these commands with the $ sign in front I receive this error:

 $git is not re-cognized as an internal or external command.

我也尝试过:

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

当我在这两行中同时运行时,命令行将返回到下一行而没有确认语句.

When I run both lines the command line returns to the next line without an acknowledgement statement.

此后,这两个命令似乎没有生效.

Afterwards the two commands do not seem to take effect.

我在Git中安装了GitBash.有什么明显的我想念的地方吗?

I have Git with GitBash install. Is there something obvious I am missing here?

推荐答案

$表示"实际上写它;它的唯一目的是指示从哪里开始该命令.

$ stands for "prompt". You should'nt actually write it; its only purpose is to indicate where to begin the command.

您应该分别编写它们.

git config --global user.name "John Doe"

(按Enter键)然后

(Press enter) then

git config --global user.email johndoe@example.com

这篇关于设置Git用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆