简体   繁体   中英

Merge two identical git-svn branch HEADs without losing link with git-svn remote branch?

I've got a pair of git-svn branches which have been manually kept in sync by applying patches and what-not; git-merge has not been used. The branches are now in sync, which is to say that git diff AB has no output at all.

[A] +----+--+--+--+--------+---+--------+-+---+->
     \  /  X  /  /   \ \  X   /        / / \ X
[B] --+-----+---------+-+--+----------------+-+->

How can I get git to consider the two branches as merged, such that a future git merge will use today's HEAD as the merge-base, without losing the git-svn association to SVN?

What I've tried

  1. git checkout A; git merge B

    This selects the SVN branch point as the merge-base, and then attempts to resolve years of duplicated cross-merging that was done manually.

(This list expected to grow)

I have no idea about the impact on SVN, but git checkout A; git merge --ours B git checkout A; git merge --ours B will record a merge B -> A where no changes are done at all, --ours means that the merge result is identical to the first parent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM