澶氫釜git椤圭洰搴撲箣闂寸殑git cherry-pick浠g爜鍚屾
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了澶氫釜git椤圭洰搴撲箣闂寸殑git cherry-pick浠g爜鍚屾相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/tomat' title='tomat'>tomat call checkout struct bsp git fetch mail conf
杩欐鏃堕棿鍋氶」鐩棿鐨勪唬鐮佸垎绂伙紝浠巊it涓婄殑A搴?nbsp; fork涓€浠藉埌B搴擄紝鐒跺悗A搴撳拰B搴撳氨鍚勮嚜鐙珛鐨勯渶姹備唬鐮佸紑鍙戙€?/p>
杩欐牱A搴撳拰B搴撶殑寮€濮嬫椂浠g爜鍩烘湰鐩稿悓锛屼絾閬囧埌涓€涓棶棰橈紝鏈変簺鏃跺€橝搴撶殑浠g爜BUG淇敼锛岄渶瑕佸湪B搴撲腑鍐嶄慨鏀逛竴涓嬶紝涓嶅お鏂逛究銆?/p>
鍥犳锛屽氨璇曚竴涓嬬敤cherry-pick鏄惁鍙銆?/p>
缁忚繃缈荤湅涓€浜涘墠杈堟枃绔犲苟寮€濮嬪皾璇曪紝锛堜互鎶夾搴撶殑release鐨勬煇娆℃彁浜ommit-->commit id is XXXXX锛屾彁浜ゅ埌B搴撶殑release鍒嗘敮涓婁负渚嬶級姝ラ濡備笅锛?/p>
1銆佹妸浠g爜鍒囧埌B搴撶殑release鍒嗘敮涓婏紝涓洪槻姝㈠嚭闂锛屽缓璁厛鎷夊彇涓€涓浠界殑鍒嗘敮銆?/p>
2銆佹湰鍦版坊鍔犲彟涓€涓粨搴揂
Zxxxxx5:B 1$ git remote add zhorigin http://git.xxxx.com/A.git
閫氳繃git remote -v 鍙互鏌ョ湅鏄惁娣诲姞鎴愬姛
Zxxxxx5:B 1$ git remote -v
origin http://git.xxxx.com/B.git (fetch)
origin http://git.xxxx.com/B.git (push)
zhorigin http://git.xxxx.com/A.git (fetch)
zhorigin http://git.xxxxcom/A.git (push)
3銆乑xxxxx5:B 1$ git fetch zhorigin 杩欐椂浼氭妸杩滅▼A搴撶殑鍒嗘敮淇℃伅鍚屾鍒版湰鍦?br />
4銆佽繖鏃跺€欏氨鍙互cherry-pick浜嗭紝閬囧埌鐩稿叧鐨勬彁绀猴紝鏍规嵁鎻愮ず鎿嶄綔灏辫浜?/p>
Zxxxxx5:B 1$ git cherry-pick ac50e25bf
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
---------------------------------------------------------------
---------------------------------------------------------------
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
5銆佷笂闈㈢殑鎻愮ず锛屾搷浣滃畬鍚庯紝灏卞彲浠it push浜嗭紝杩欐椂鍊欙紝绁炲鐨勪竴骞曞嚭鐜颁簡,鎶婁慨澶岮搴撶殑BUG鍒嗘敮 clone浜嗕竴浠藉埌B搴撲笂浜嗭紝锛堝鏋滃湪A搴撶殑release鍒嗘敮鐩存帴淇敼鐨勶紝鍙兘灏辩洿鎺ush鍒癇搴撶殑release浜嗭紝鏈夊叴瓒g殑鍙互璇曚竴涓嬶級
Zxxxxx5:B 1$ git push
Enumerating objects: 69, done.
Counting objects: 100% (69/69), done.
Delta compression using up to 8 threads
Compressing objects: 100% (20/20), done.
Writing objects: 100% (39/39), 4.01 KiB | 2.00 MiB/s, done.
Total 39 (delta 13), reused 10 (delta 3)
To http://git.xxxx.com/B.git
ccccc..yyyyyy bugfix-branch-xxxx-A -> bugfix-branch-xxxx-A
6銆佽嚦姝搴撶殑BUG淇敼鍒嗘敮鍦˙搴撳凡缁忔湁浜嗭紝涔嬪悗鐨勬祦绋嬪氨绠€鍗曚簡锛屽拰鏅€氱殑cherry-pick娴佺▼涓€鏍蜂簡
鏈湴纭繚鍒囧埌B搴撶殑release
Zxxxxx5:B 1$ git checkout release
Zxxxxx5:B 1$ git cherry-pick yyyyyy
Zxxxxx5:B 1$ git push
澶囨敞锛?/span>
杩欓噷闈㈡湁涓€浜涚粏鑺傦紝寰堟湁鎰忔€濓紝姣斿涓轰粈涔圓搴揷lone鍑轰竴涓垎鏀埌B搴擄紝鏂扮殑鍒嗘敮鐗堟湰鐨勮捣濮媍ommit id涓轰粈涔堟槸 ccccc绛夌瓑
以上是关于澶氫釜git椤圭洰搴撲箣闂寸殑git cherry-pick浠g爜鍚屾的主要内容,如果未能解决你的问题,请参考以下文章