菜鸟才开始使用SourceTree,出现了两个小问题,特此整理一下,希望对各位新手有帮助。刚开始以为装了SourceTree就不用装git了,其实不然,不装git就会出现下面第一个问题:

 

1、新手使用SourceTree 一定要装git客户端才行,不然克隆远程url会一直提示 “这是一个无效的源路径/URL”(本人已经掉坑里一次了,希望读者不要再犯这么简单的错误)

如图所示

原因:没有启用git(截图忘记保存了)

解决办法:工具 ——》选项  ——》 git, 启用git 就可以了。

启用之后如图:

2、提交代码到远程的时候报错,提示如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F C:\Users\AppData\Local\Temp\yo1s42oy.fz2
 
*** 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 'Colin@JustForMoney.(none)')

  如图:

原因:没有设置用户名和邮箱

解决办法:运行git;敲如下命令

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

 设置完毕之后,就可以正常使用了。

转自:http://www.cnblogs.com/jiaoshou/p/4447070.html

Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐