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 "[email protected]"
  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 [email protected]

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

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

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

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

Git中容易出错的地方_第1张图片

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

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中容易出错的地方_第2张图片

解决方法:

Git中容易出错的地方_第3张图片

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

git remote rm origin

git remote add origin [email protected]:【用户名】/项目名.git

git push origin

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

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

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

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


你可能感兴趣的:(Git)