简体   繁体   中英

Subversion: ignore item but only on branch

Suppose I have a binary data file 'foo' that I want to version on branch 'dev' but not on branch 'feature'. If my current working copy is 'feature', can I simply ignore foo without affecting version control of 'foo' for the 'feature' branch? When I merge 'dev' into 'feature', perhaps before a merge from 'feature' into 'dev', what will happen?

Context: We have a dev environment where people work on features in their own branch then merge into the 'dev' branch which ultimately is merged to trunk for builds. We're supposed to merge 'dev' into our own branch before merging our own into 'dev' again once our local changes are stable. I want to preserve my local 'foo' file from merges, and never commit it, despite it being version controlled on 'dev'.

First things first: don't check in binaries. ever.

Secondly - to answer your question - it's going to be messy... you could do either of:

  • Add it to svn:ignore on the dev branch and then block that changeset from a merge by editing svn:merginfo on the feature branch so that changeset won't get inadvertently merged (you will forget to exclude it from the merge - it's human)
  • Add it to your global-ignores in ~/.subversion/config. Which will affect all your working copies. This path will lead you to forget to checkin an update to the binary on branches/feature when you wish.

I strongly urge you to just never check the file in.

Set the svn ignore on the branch. Upon merge, however, you will have to be careful to preserve, or overwrite the property.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM