【git】如何进行 git 的 cherry-pick 操作

2024-04-06  本文已影响0人  熊本极客

1.添加远程主仓并更新内容

$git remote
origin https://gitee.com/linlong_job/boostkit-bigdata.git

$git remote add boostkit https://gitee.com/kunpengcompute/boostkit-bigdata.git

$git remote
boostkit https://gitee.com/kunpengcompute/boostkit-bigdata.git
origin https://gitee.com/linlong_job/boostkit-bigdata.git
#更新全部远程仓库的内容
$git remote update
Fetching origin
Fetching boostkit

#指定远程仓库更新内容
$git remote update boostkit
Fetching boostkit

2.cherry-pick操作

$git cherry-pick 9be62327b6c99c5a35baela77b12a401314d8bc3
[omnioperator-spark3.3.1-mrs 12bdbf6d] fix bug
Author: d00807371 <dengzhaochuChuawei.com>
Date: Sat Mar 9 10:31:55 2024 +0800
1 file changed, 2 insertions(+), 2 deletions(-)

#说明:merge记录(e759ff7f6290408742ebObe4f5664cc101e8bC58)会有如下报错
$git cherry-pick e759ff7f6290408742ebObe4f5664cc101e8bC58
error: commit e759ff/f6290408742ebObe4f5664cc101e8bc58 is a merge but no -m option was given.
fatal: cherry-pick failed
上一篇下一篇

猜你喜欢

热点阅读