我正在尝试使用崎岖的(红宝石)在这样的分支上挑选一个提交:
repo.fetch('origin', ['origin/stable/branch_name'],credentials: rugged_credentials)
repo.reset('origin/stable/branch_name', :hard)
repo.checkout('origin/stable/branch_name')
repo.cherrypick('929bab12fdf6f4727ba0a8d704df01fe1e780449')
但似乎樱桃选择正在产生未提交的更改,我希望在该分支上提交该提交,只需将其推送到远程引用。
这是git status
樱桃采摘后的输出:
HEAD detached from 3807abe
You are currently cherry-picking commit 929bab1.
(all conflicts fixed: run "git cherry-pick --continue")
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: README.md
如果我在摘樱桃后推到遥控器,我得到:
>
irb(main):033:0> repo.remotes['origin'].push("HEAD:refs/heads/stable/branch_name",credentials: rugged_credentials)
=> {"refs/heads/stable/2021-12-01"=>"internal error"}
似乎樱桃挑选正在做类似的事情:
git cherry-pick 929bab12fdf6f4727ba0a8d704df01fe1e780449 --no-commit
但我在 Rugged cherrypick 中没有看到这样的选项