碼雲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 [email protected]:XXX/project.git
  7. git pull
  8. git status
  9. 把備份裏面需要的文件都扔進來,git add . >> git commit -m "XXX" >> git push -u origin master
  10. ok

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章