windows上安装的git进行配置用户名和邮件地址显示command not found?

作者站长头像
站长
· 阅读数 12

配置用户名和邮件地址

$ git config --global user.name "李老师"
$ git config --global user.email li@csdn.net

目标文件

$ git config --list
user.name= "李老师"
user.email=li@csdn.net
color.status=auto
color.branch=auto
color.interactive=auto
color.diff=auto
...

如下是我的git配置,和上面的目标文件展示不一致

$ git config --global user.name "李老师"
bash: $: command not found

Administrator@WIN-O379IL963GN MINGW64 ~
$ $ git config --global user.email li@csdn.net
bash: $: command not found

Administrator@WIN-O379IL963GN MINGW64 ~
$ git config --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=D:/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
init.defaultbranch=master

Administrator@WIN-O379IL963GN MINGW64 ~
$
回复
1个回答
avatar
test
2024-07-13

网上教程里面命令前面的 $ 表示这个命令由普通用户执行,# 表示用 root 用户执行,这只是用来提示你的。你执行的时候不需要包含这个。

回复
likes
适合作为回答的
  • 经过验证的有效解决办法
  • 自己的经验指引,对解决问题有帮助
  • 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
  • 询问内容细节或回复楼层
  • 与题目无关的内容
  • “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容