Git中容易出错的地方

git Please tell me who you are解决方法:

git commit -m "some init msg"
*** 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 'Administrator@MS-201610130300.(none)')

解决方法:

所以解决方法是当出现这个上述提示后 接着补充
你在命令行中执行

git config --global user.email "你的邮箱"

($ git config --global user.email 13693916721@163.com)

git config --global user.name "你的名字"

($ git config --global user.name Zhao)

(注意 “ 前面是有空格的)

输入完后再接着执行git commit 即可成功!


================================================================================

git aborting commit due to empty commit message

这个异常的原因是:在git 提交时没有写注示文字。原因引发条件:$git commit ,解决方法:

$git commit -m "hello,i will commit "

================================================================================

git push 失败出现error: src refspec master does not match any.解决方案

git push到github失败

错误提示

error: src refspec master does not match any.

error: failed to push some refs to 

常见原因:

1.本地git仓库目录下为空

2.本地仓库add后未commit

3.git init错误

解决:

1.控制面板打开文件夹选项  打开隐藏文件和文件夹显示

2.到本地仓库目录下查看是否有.git文件夹——无 则git init

3.看.git文件夹下是否有之前提交的文件——若无 则重新 git commit (如果之前git add过的话 没有就要重新 add commit)

===========================================================================

使用git push origin master出现fatal:remote error


作为小白,计算机的好多东西都不懂,遇到问题就慌了,但是作为计算机专业的孩子,还是要自己慢慢学会找答案,所以要耐得下心来找法子,各种百度,各种码农专业网站找找,这是必经过程,好了先废话不多说了,开始今天的主题啦。

最近开始学git,在使用git push命令将本地的文件push到github上时,遇到了以下问题:


解决方法:


这是查找别人的博客得到的解答,好像说是使用git clone "项目地址"时,将https换成git而造成的,所以之后要使用命令:

git remote rm origin

git remote add origin git@github.com:【用户名】/项目名.git

git push origin

这是再根据提示再输入git push --set-upstream origin master,然后再输入git push origin就可以提交成功啦!

【注意】在第二条命令中【用户名】前一定要改成“:”,不能是“/”,不然还是会报错的

https://blog.csdn.net/tozeroblog/article/details/79423807

===============================================================================


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值