Sorry for any title-gore. I wasn't entirely sure how to phrase this question, but I can offer a deeper explanation here.
So I have 3 branches, master
(production), dev
(where all our most recent work is congregated), and a feature branch (a feature I've been working on for the past few weeks).
I've been rebasing dev
into my feature branch for the past few weeks to keep up with changes, but now I'm tasked with deploying this feature directly to production (master branch) without bringing commits from the dev
branch.
So my first thought was to interactively rebase feature branch (let's call it feature/A) into master
, but when I try that I see 28 old commits, and none of the relevant commits that I want to rebase. There are nearly 50 commits that need to be transferred from feature/A
to master
.
How can I go about accomplishing this?
答案 0 :(得分:0)
通常,当您将一个分支重新设置为另一个分支时,可以跳过不想包含的提交。为了轻松实现此目标,您可以使用一个名为TortoiseGit的工具。重新设置基准时,可以轻松跳过(或事件编辑)提交。
答案 1 :(得分:0)
如果我正确理解您的问题,这可能会有所帮助。
假设您的分支A 具有ID为{{c1,c2,c3,c4
}的提交
并且您希望提交c2,c3
合并到另一个 B分支。
为项目打开cmd,然后运行此命令git cherry-pick c1
,并同时运行其他提交,即git cherry-pick c2
。