git-svn dcommiting a single git commit

前端 未结 4 577
感动是毒
感动是毒 2021-01-31 04:01

Given multiple unpushed git commits, is it possible to git-svn dcommit only one of those commits?

e.g. I have commit foo, bar, and baz, but rig

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 04:49

    I have one sort of crusty answer. You can create a new branch with out foo, bar, and baz in it and then cherry-pick bar to the new branch and then git-svn dcommit that branch and remove it when you're done. That doesn't seem very elegant though.

    So assuming foo, bar, and baz are in branch x and master doesn't have any of them.

    git branch y master

    git checkout y

    git cherry-pick

    git svn dcommit

    git checkout x

    git svn rebase

    git branch -d y

    If master does have these commits you can reset the head as Sizzler suggests.

提交回复
热议问题