[英]How to pull local master into local branch
我有一個遠程origin/master
和一個遠程分支remote_branch
。 我也有本地master
和本地分支local_branch
。 當我嘗試使用git pull master local_branch
將本地master
拉入local_branch
,我得到了這個。
fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
但是,當我執行git branch
我看到了:
* loca_branch
master
為什么我不能從我的本地master
那里拉?
將 local_branch 的更改合並到master
git checkout master
git merge local_branch
合並從 master到local_branch 的更改
git checkout local_branch
git merge master
拉是當你有一個“原點”回購:)
git pull
是git fetch && git merge
的別名,您無法從本地分支(僅從遠程)獲取 - 實際上您不需要,如果您打算將master
合並到local_branch
,只需在打開時使用git merge master
local_branch
。
正如錯誤消息所說, master
不是它知道的存儲庫。 這是因為使用git pull master local_branch
您說“從遠程存儲庫master
獲取分支local_branch
並將其合並到我當前簽出的分支中”。
但這不是你所追求的。 您想說“將我的本地分支master
合並到我的本地分支local_branch
,檢查它是否還沒有”,那就是git checkout local_branch && git merge master
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.