Robotronx
Robotronx

Reputation: 1818

Splitting revision into two revisions

I have accidentally commited some code to the branch that (alongside my new code) also consisted of code from the trunk. A couple of files have been changed on the trunk (that I have merged with my working copy of the branch), but non of those have also been worked upon by me.

Is there a way to split this revision so one revision will have only files that were merged from the trunk and the other one only files that I have changed?

Edit: I'm using Tortoise.

Upvotes: 0

Views: 676

Answers (1)

alroc
alroc

Reputation: 28174

You can't edit an already-committed revision without performing major surgery on the repository.

You can, however, roll back the changes made to the trunk (or the branch) via a reverse merge. This will get you back to the previous state and keep a record of everything in the repository history.

I also have to point this out:

A couple of files have been changed on the trunk (that I have merged with my working copy of the branch), but non of those have also been worked upon by me.

This implies to me that you and at least one other person are sharing a working copy. This is a very bad habit to fall into. You lose accountability & the ability to keep track of who really made changes. As you've now learned, changes that aren't ready to be committed may be committed, by someone other than the true author.

Each user needs to have their own working copy that they and only they work with.

Upvotes: 2

Related Questions