git cherry-pick 合并多个提交

/* 多提交合并 */
将 ac4 多个提交合并到 b_ac4_202508

git checkout b_ac4_202508
git lg ac4                          // 6178ae4b .. d7980ec5, 共四个

git cherry-pick 6178ae4b^ .. d7980ec5

    Performing inexact rename detection: 100% (442092/442092), done.
    Auto-merging Snap.cpp
    CONFLICT (content): Merge conflict in Snap.cpp
    error: could not apply 5178ae4b... [Mod] 抽一帧存JPG照片
    hint: after resolving the conflicts, mark the corrected paths
    hint: with 'git add <paths>' or 'git rm <paths>'
    hint: and commit the result with 'git commit'

git status

    On branch b_ac4_202508
    Your branch is up to date with 'origin/b_ac4_202508'.

    Cherry-pick currently in progress.
      (fix conflicts and run "git cherry-pick --continue")
      (use "git cherry-pick --skip" to skip this patch)
      (use "git cherry-pick --abort" to cancel the cherry-pick operation)

    Changes to be committed:
            modified:   CMakeLists.txt
            new file:   Control.cpp
            modified:   Snap.h
            new file:   vsync.h

    Unmerged paths:
      (use "git add <file>..." to mark resolution)
            both modified:   Snap.cpp

vi Snap.cpp
git add Snap.cpp
git cherry-pick --continue

    [Mod] 抽一帧存PNG照片
      
    Change-Id: 5ed1369da2b4b044039fb801dd935c26b6a60ce0f

    /* 解决冲突时删除上面的即可 */
    # Conflicts:    
    #       Snap.cpp
    #
    # It looks like you may be committing a cherry-pick.
    # If this is not correct, please remove the file
    #       .git/CHERRY_PICK_HEAD
    # and try again.


    # Please enter the commit message for your changes. Lines starting
    # with '#' will be ignored, and an empty message aborts the commit.
    #
    # Date:      Mon Aug 12 13:58:40 2024 +0800
    #
    # On branch b_ac4_202508
    # Your branch is up to date with 'origin/b_ac4_202508'.
    #
    # Cherry-pick currently in progress.
    #
    # Changes to be committed:
    #       modified:   CMakeLists.txt
    #       new file:   Control.cpp
    #       modified:   Snap.cpp
    #       modified:   Snap.h
    #       new file:   vsync.h

git cherry-pick --continue

    [b_ac4_202508 5e50d2bc] [Mod] 增加 AC 头文件与源码路径,以处理合并后编译报找不到头文件的异常
     Date: Fri Aug 23 11:41:51 2024 +0800
     1 file changed, 4 insertions(+), 3 deletions(-)

git status

    On branch b_ac4_202508
    Your branch is ahead of 'origin/b_ac4_202508' by 4 commits.
      (use "git push" to publish your local commits)

    nothing to commit, working tree clean

git push origin HEAD:refs/for/b_ac4_202508

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值