简体   繁体   中英

How to “link” two branches of the same code base that were created separately (TFVC -> GIT migration)?

We are moving from TFVC to GIT and managed to import the history of our branches, the problem is that the link between the two branches were lost during migration.

树枝的外观 Our current branches

If you look at the image above, the pink line was imported as the master branch and the blue was imported as the dev branch. In TFVC the dev branch was created from master, so instead of the blue line starting from the void it should be a new branch from the master.

Is there anyway to "link" them to reflect how they were created on TFVC?

You can use git rebase to "link" the branches, just as commented by max630, place the blue branch on top of any master commit which you want.

Try below commands:

git checkout -b temp <commit on red>

git rebase temp blue

git push -f blue

You can also reference this thread : Can I safely rebase one branch into other and then to master?

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