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

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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容