码云GIT推送失败 - the remote end hung up unexpectedly Connection to gitee.com closed by remote host - Go语言中文社区

码云GIT推送失败 - the remote end hung up unexpectedly Connection to gitee.com closed by remote host


前言

以前直接是在码云上新建了一个私有库,在直接git clone xxx下来的,现在git push不了。

 

错误提示

Your branch is based on 'origin/xxxx', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)

git push -u origin master
fatal: the remote end hung up unexpectedly
Connection to gitee.com closed by remote host.

git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working tree clean

 

解决办法

  1. 先把整个项目目录备份起来
  2. 删掉这个目录
  3. mkdir Name-of-your-Project
  4. cd Name-of-your-Project
  5. git init
  6. git remote add origin git@gitee.com:XXX/project.git
  7. git pull
  8. git status
  9. 把备份里面需要的文件都扔进来,git add . >> git commit -m "XXX" >> git push -u origin master
  10. ok

 

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq285744011/article/details/105267727
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-04-19 12:40:45
  • 阅读 ( 1239 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢