2012-11-30 113 views
1

git branch -a命令給了我下面的輸出:奇怪的遠程分支

master 
stable 
remotes/origin/master 
remotes/origin/restoring_entered_information_from_post 
remotes/origin/stable 

,但沒有這樣的一個分支restoring_entered_information_from_post在Github上,我從來沒有建立在本地,並嘗試與git push origin :restoring_entered_information_from_post刪除它,它迴應:

error: unable to push to unqualified destination: restoring_entered_information_from_post 
The destination refspec neither matches an existing ref on the remote nor 
begins with refs/, and we are unable to guess a prefix based on the source ref. 
error: failed to push some refs to '[email protected]:MyCompany/mywebsite.git' 

回答

5

最有可能的分支確實存在過去,並在Github上被刪除。 Git默認不會刪除這些陳舊的分支。要刪除不存在的遠程分支,可以使用:

git remote prune origin 

您可能要在空運行模式下先運行它,看看它會刪除:

git remote prune -n origin