[英]When connected to BranchA via git checkout BranchA, if I do git pull BranchB then will BranchB code get pulled into BranchA?
[英]Why git pull origin branchA:branchA can't work and pull origin branchA can work?
我的git動作如下:
git pull origin mybranch1.3.3:mybranch1.3.3 ------>它拒絕了,告訴我mo-fast-forwrd
git pull origin mybranch1.3.3 -------->效果很好。
有什么區別? 最后一個“ mybranch1.3.3”不是我的本地分支嗎?
springdeiMac:myApp qiushuitian$ git pull origin mybranch1.3.3:mybranch1.3.3
remote: Counting objects: 196, done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 95 (delta 61), reused 0 (delta 0)
Unpacking objects: 100% (95/95), done.
From 192.168.1.39:myApp
! [rejected] mybranch1.3.3 -> mybranch1.3.3 (non-fast-forward)
a1a652f..3fd1572 mybranch1.3.3 -> origin/mybranch1.3.3
springdeiMac:myApp qiushuitian$ git pull origin mybranch1.3.3
From 192.168.1.39:myApp
* branch mybranch1.3.3 -> FETCH_HEAD
這是git pull語法
git pull [<options>] [<repository> [<refspec…>]]
其中options
, repository
和refspec
是可選參數,但是必須將它們提供給git命令,因為建議這樣做,否則默認行為將如GIT Ducumentation所述
人們通常在不提供任何參數的情況下使用git pull。 傳統上,這相當於說
git pull origin
在您使用Refspec的第一個命令中,
所以在git pull origin mybranch1.3.3:mybranch1.3.3
的LHS:是你的<src>
和RHS到:是你的<dst>
並忽略此錯誤,您可以在Refspec中使用+
正如吉特所說
refspec的格式是
optional +
,后跟<src>:<dst>
,其中<src>
是遠程引用的模式,而<dst>
是將這些引用本地寫入的位置。+
告訴Git更新參考,即使參考不是快速轉發。
是的,在第二個命令mybranch1.3.3
是您的本地分支。 此命令意味着從origin
獲取數據merge
其merge
到本地mybranch1.3.3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.