Create branch at specific change set, move changests after this point to different branch

痴心易碎 提交于 2019-12-25 03:36:13

问题


Hypothetical scenario:
By mistake, I've been working away on my 'Main' branch.

What I need to do, is effectively reset my Main branch to a particular changeset - 1001 for example. Changesets after 1001, I want to move to a new branch - 'Dev'

Is this possible?

I come from a git background, so if this were a git repository, I would probably use something like:

git checkout -b Dev 1001  //create branch at 1001
git checkout Main  //back on Main
git reset --hard 1000  //reset main to 1000

回答1:


No, this is not possible in the server based source control world.

I would recommend that you take a copy of your code, and roll back the change.

Then create a branch and overwrite the changes that you copied. Dirty, but works...

Solution: Use git



来源:https://stackoverflow.com/questions/29969773/create-branch-at-specific-change-set-move-changests-after-this-point-to-differe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!