Git bash设置拒绝全局/本地参数,无法设置用户帐户

时间:2016-07-06 18:04:06

标签: git bash

操作系统:Win8.1 64位; Git v 2.9.0

Git bash 2.9.0设置拒绝用户名&电子邮件配置错误消息

  • 已安装 - > exe' d - >没有欢迎消息只是电脑名称和$ prompt。
  • 在命令中,我输入了TA提供的代码: config [--local | --global] user.email" my email@etc.com" ;记录错误消息:: --global] user.email command not found
  • 重复使用user.name" name"并记住这些错误:: bash:-global] user.email命令未找到;错误:key不包含section [--local。这些是TA在小组讨论中留下的指示。
  • 然后我尝试将全局括起来(git config [--global]并记住致命错误:不在git目录中。
  • 我卸载了程序并希望重新安装,但我担心新的d / load只会从程序的第一个实例中获取旧设置。 我需要做些什么来设置我的git bash?我将在几天内完成作业。谢谢。

enter image description here

2 个答案:

答案 0 :(得分:1)

  

在命令中,我输入了TA提供的代码:config [--local | --global] user.email" my email@etc.com" ;;记录错误消息:: --global] user.email command not found

符号[--local | --global]是可选的OR选项。 [-A|-B]表示您应使用-A-B作为参数来调用该程序。所以,你想:

$ git config --local user.email you@example.com

$ git config --global user.email you@example.com

来自git help config :(大胆是我的)

  

在读取时,默认情况下会从系统,全局和存储库本地配置文件中读取值,并且可以使用选项 - system, - global, - local 和--file          告诉命令只从该位置读取(参见“FILES”一节)。

  • --local表示仅限存储库配置。
  • --global表示您的所有git操作(用户级别)
  • --system表示系统范围配置(用户默认为未设置上述级别的用户)

答案 1 :(得分:1)

  • 本地或全局参数周围没有括号。
  • 定义的参数和参数之间有空格
  • user.name输入为:

    $ git config --global user.name "Your Name"
    $ git config --local user.name "Your Name"
    
  • user.email输入为:

    $ git config --global user.email "Your email"
    $ git config --local user.email "Your email
    

验证用户名和用户电子邮件:

$ git config --list