Jump to content

Ignore file when merging from different branch


mostertag

Recommended Posts

Hey everyone,

 

I would like to knbow if this is possible to ignore some file when merging from another branch. Let me explain.

  • I have two branch A and B.
  • I have a folder named X in both branches and a folder named Y in the branch B.
  • I am on the branch B and I make some modification inside both folders, X and Y, and I commit, always on branch B.
  • Now I go back on branch A and I want to merge from branch B but I only want to retrieve the modifications made inside folders X not Y.

How can I do that ? Is it possible ?

Tell me if this is not clear enough.

Thanks a lot !

Link to comment
Share on other sites

Hi,

 

- If the changes were performed in different changesets, you can select the desired changesets to merge (this is a Plastic "cherry pick" operation). You don´t need to merge all the changesets of the branch.

 

- If the changes were performed in the same changeset and there are conflicts, you can just select "Keep destination" on the desired conficts.

 

Regards,

Carlos

Link to comment
Share on other sites

I'm thinking you have to merge, then delete the files you don't want, then commit the delete.

 

As you pointed out, you have directory Y in branch B that you do NOT want in branch A, but when you merge from branch B (where folder Y is under source control) to branch A (where they don't currently exist), the merge will create them with NO CONFLICT - so no way to deselect them.

 

As pointed out above, the only possible way around that would be to do a cherry pick - assuming the directory was (or files were) created in an early change set - meaning you do the merge from each change set on the branch, not the branch itself.  Cherry picking a change set will only show the files that have changed for that specific change set - not all previous change sets (as selecting the branch would).  If there were changes on folder X AND folder Y in a single change set, you will end up with folder Y in branch A that would have to be deleted post merge.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...