Ignore files / folders when merging

I am currently using SVN for version control of my software projects. In the current project, I have a trunk, for general client functions and specifications and branches, for specific clients.

Is there a way to mark some files / folders that should not merge into branches every time I perform such an operation?

+4
source share
2 answers

There is an option that you merged, actually meaning that the merge does not modify the files in the target, but marks it in the merge tracking details. Thus, changes will never occur in files to be merged, ever!

This function is called a command line version only.

From link text

The -record-only option works with -r and does exactly what you think: it marks the revision as merged (or unrelated if you use the negative version syntax β€œ-"), without changing anything except mergeinfo. For example, this would be useful when someone edited a file manually in such a way as to effectively incorporate changes that have already been made elsewhere. Instead of having the original change transferred to the next synchronization merge, thereby risking text conflicts where the two versions are trivially different, you can simply write the change as already merged. (For more information, see Merge Tracking Requirements and Change Lock in the Subversion Book.)

+2
source

I do not immediately see the solution, but it would be easy for the script to do something. What I give you is not checked for errors.

First you must make a list of directories that you would like to exclude. ~ / .Svn-merge-excludes is called

#regexes to exclude ./helpfiles/ ./deploy_scripts/ ./models/customer_integration 

Then you must write another script to return these directories to the branch after you merge the envelope into them.

 #/usr/bin/bash # I am assuming that you made the excludes based on the root directory # so that relative paths will work for dir in $(cat ~/.svn-merge-excludes) ; do svn revert -R $dir done 

That should work. The big advantage here is the β€œ-R” option in the return, acting recursively to the directory. Therefore, your workflow will look something like this.

 # cd path/to/branch # svn merge -r123:245 svn://svnserver.com/svn/trunk # revert_excludes_from_branch.sh 

Then you will handle the conflicts and then commit. If you use windows, then the batch file will work, you can simply type the repeat commands sequentially.

+2
source

Source: https://habr.com/ru/post/1303139/


All Articles