I'm currently using SVN for versioning my software projects. On an ongoing project, I have the trunk, for client common features and specifications and branches, for client specific ones.
Is there any way to mark some files / folders that shouldn't be merge into branches each time I perform such operation?
The simplest way, if you have unmerged paths, use git merge --abort to abort the merge. This way your code will look the same as it was before trying to merge with some other branch...
A . gitignore file is a plain text file that contains a list of all the specified files and folders from the project that Git should ignore and not track. Inside . gitignore , you can tell Git to ignore only a single file or a single folder by mentioning the name or pattern of that specific file or folder.
I don't immediately see a solution, but it would be easy enough to script something up. What I give you is not bug tested.
First you would make a list of directories that you would want exclueded. Called ~/.svn-merge-excludes
#regexes to exclude
./helpfiles/
./deploy_scripts/
./models/customer_integration
Then you would write another script to revert those directories in the branch after you merge the turnk 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 thing here is the '-R' option in the revert acting recursively on the directory. Therefore your workflow will look something like.
# cd path/to/branch
# svn merge -r123:245 svn://svnserver.com/svn/trunk
# revert_excludes_from_branch.sh
Then you would handle the conflicts and then commit. If you are using windows then a batch file would work too, you could just type out the revert commands in series.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With