在特定变更集处创建分支,此后将changets移动到其他分支 [英] Create branch at specific change set, move changests after this point to different branch

查看:117
本文介绍了在特定变更集处创建分支,此后将changets移动到其他分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设的情况:

误了,我一直在我的 Main分支工作。

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

我需要做的是有效地将Main分支重置为特定的变更集-例如1001。
1001年后的变更集,我想移至新分支-'Dev'

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'

这可能吗?

我来自git背景,因此,如果这是一个git存储库,我可能会使用以下内容:

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


推荐答案

不,这在基于服务器的源代码管理世界中是不可能的。

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...

解决方案:使用git

Solution: Use git

这篇关于在特定变更集处创建分支,此后将changets移动到其他分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆