简体   繁体   中英

How to convert git branches to mercurial named branches?

Ive tried to use --branchmap option from this docs , but it does not helped. I think that it is fundamentally possible to convert Git branches to Mercurials named branches - because we always can say what is the difference between Git repo with a branch and same repo but without that branch.

The problem here is that Git branches are just pointers to a commit. All commits that are ancestors of this commit are considered to be "on the branch", then. However, this later notion is broken if you see a commit only belonging to one branch, because simply having a second branch will create ambiguity in this regards: at least the root node is now in both branches.

Mercurial's named branches - for better or for worse - are effectively node-colorings. Ie you color your nodes (commits) with one color (the named branch), and with one only. So fundamentally, it is not possible to convert Git branches to Mercurial named-branches and keep the meaning of "X is on branch Y" the same.

If you want a similar concept to Git branches in Mercurial, take a look at bookmarks.

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