git错误:error(暂时遇到的已解决)

1.git push后出现错误 ![rejected] master -> master(non-fast-forward) error:failed to push some refs to XXX

1

解决方案:
强制上传覆盖远程文件:

git push -f origin master

2.git 上传文件到仓库上提示:origin does not to be a git repository

解决方案:

 重新输入一次:git remote add origin [email protected]:yourusername/test.git
 然后再输入:git push -u origin master 就可以提交了

3.Please tell me who you are.

在码云提交代码的时候出现了这个问题:

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 ‘chenxiao@LAPTOP-S9MH6P88.(none)’)
解决方法很简单,只需在当前输入下面两句命令,把引号里的改成自己的邮箱和账号就OK了

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

然后就可以做接下来的操作了

3.idea中,发布项目到码云的Git中,提示:push to origin/master war rejected"。

解决方案:

1.切换到自己项目所在的目录,右键选择GIT BASH Here,Idea中可使用Alt+F12

2.在terminl窗口中依次输入命令:

git pull

git pull origin master

git pull origin master --allow-unrelated-histories

3.在idea中重新push自己的项目,成功!!!

猜你喜欢

转载自blog.csdn.net/qq_35416214/article/details/105348072