سؤال

Well, I made a mistake and merged another branch into my working branch, but instead to commit this merge I added other changes (well I had to edit a few merge conflicts, but there are now other changes too).

Is there a way to separate the merge and my other changes? I'd be ok redoing the fixes for the merge conflicts, but I really don't want to redo my other changes.

I thought about getting out the merged files somehow and then shelve my other changes. Then do the merge again and commit that. Finally unshelve and continue work. But I couldn't find a way to umnerge.

هل كانت مفيدة؟

المحلول

If you haven't committed the merge yet:

  1. Save the files with your changes somewhere. Maybe zip up the working directory just in case.

  2. Shelve everything with bzr shelve --all.

  3. Undo the merge with bzr revert.

  4. Redo the merge and commit it.

  5. Unshelve. What was merged should be unchanged. The difference should be only your own, new changes.

If you already committed the merge:

  1. Create a new branch from the point before you merged.

  2. Redo the merge and commit it.

  3. Copy the files from the other branch over the current branch. The difference should be only your own changes.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top