在Sourcetree中提交代码库时出现错误,Git窗口客户端

15

我是bitbucket、git和sourcetree的新手。我在bitbucket上创建了一个仓库,然后安装了适用于Win 7的sourcetree客户端,接着通过本地桌面文件夹克隆了该仓库,在本地文件夹中放置了一个文件。但是,当我尝试提交更改时,sourcetree出现以下错误:

git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F C:\Users\shahjahan_khokher\AppData\Local\Temp\vrkvrvyu.uba

* Please tell me who you are.

Run

git config --global user.email "you@example.com" git config --global user.name "Your Name"

to set your account's default identity. Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'shahjahan_khokher@shahjahan_khokh.(none)')

Completed with errors, see above.

我该如何解决这个问题,并成功进行提交和推送。

3个回答

31

在不使用Git Bash的情况下解决身份问题的最简单方法是直接在SourceTree中设置:

  1. 转到菜单:工具 -> 选项
  2. 在“常规”选项卡上填写“全名”和“电子邮件地址”字段
  3. 单击“确定”按钮
  4. 提交您的文件 :)

18

我在朋友的帮助下解决了上述问题,解决方案如下:

  1. 首先从下载 Git for Windows安装Git Bash命令行到您的系统中。

  2. 然后从开始菜单 - Git - Git Bash打开Git Bash,并运行以下命令

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

git config --global user.name "Your Name"
现在再次尝试提交,问题将得到解决。

git config --global user.email "you@example.com" 只需要输入这行代码,对我来说有效,(UBUNTU 14.10) - Steven Du

0

9
仅仅链接到其他网站不符合stackoverflow的精神。相反,应该在这里明确地输入信息。您仍然可以包含链接。 - Francois Botha

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接