美文网首页
【git】如何进行 git 的 cherry-pick 操作

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

作者: 熊本极客 | 来源:发表于2024-04-06 21:28 被阅读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
    

    相关文章

      网友评论

          本文标题:【git】如何进行 git 的 cherry-pick 操作

          本文链接:https://www.haomeiwen.com/subject/uskztjtx.html