当前位置:   article > 正文

error: failed to push some refs to ‘git@gitee.com:xxxxx/dianshang20220625.git‘解决思路

error: failed to push some refs to ‘git@gitee.com:xxxxx/dianshang20220625.git‘解决思路

问题描述

新人新项目

第一次绑定公共钥匙以后,

git init  

git add .

git commt -m  xxx

git remote add origin git@gitee.com:xxxxxxx/myhr-2022625.git

git push -u origin master的时候报错 (以下)

To gitee.com:hellohaotian/dianshang20220625.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitee.com:hellohaotian/dianshang20220625.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

- 尝试了很多解决方案,

最后没搞清楚原因,但是这个操作是朋友老师讲的 

首先删除  .git 文件(Mac可以shift+ command+ 点 看到隐藏文件)

然后重新执行 

git init 

git add .

git commit -m  xxx

git remote    add origin git@gitee.com:xxxxxxx/myhr-2022625.git   (含义是给远程仓库起个名字origin)

git push -u origin master

后续操作

解决 

电子竞技

菜是原罪 

加油

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/人工智能uu/article/detail/858479
推荐阅读
相关标签
  

闽ICP备14008679号