簡體   English   中英

git遠程跟蹤分支返回“請求的上游分支不存在”

[英]git remote tracking branch return "requested upstream branch does not exist"

我有這樣的 git 配置:

[remote "origin"]
   url = git@bitbucket.org:archie/learn-express.git
   fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
   remote = origin     <==== 
   merge = refs/heads/master
[remote "znotanto"]
   url = https://archie@bitbucket.org/znotanto/learn-express.git
   fetch = +refs/heads/*:refs/remotes/znotanto/*

我想將我用箭頭顯示的部分更改為znotanto 我試過git branch master --set-upstream-to znotanto/master from so但給我錯誤

錯誤:請求的上游分支“znotanto/master”不存在

znotanto ( https://archie@bitbucket.org/znotanto/learn-express.git ) 上復制的存儲庫實際上有一個名為master的分支嗎?

如果是這樣,請使用:

git fetch znotano

讓你的 Git 了解它。 這將使您的 Git 創建您的遠程跟蹤名稱znotanto/master ,之后您將能夠將znotanto/master設置為任何分支的上游。

如果沒有,您需要首先在znotanto的 Git 存儲庫中創建名稱master ,以便您的 Git 看到它,以便您的 Git 將創建您的遠程跟蹤名稱znotanto/master 所以在這種情況下,首先在那里創建那個分支——具體如何並不重要——然后運行git fetch znotanto

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM