How can I overwrite a file from a specific branch to a trunk?
Like for example I have https://web/trunk/text.cpp file. Then I want my https://web/branches/tt_branch/text.cpp overwrite the trunk file.
This basic syntax— svn merge URL —tells Subversion to merge all changes which have not been previously merged from the URL to the current working directory (which is typically the root of your working copy).
If you merge a branch into trunk using "svn merge --reintegrate", you are recommended to delete the branch. If you want to do further development in that branch, you should "re-branch", effectively create a new branch with the same name, but rooted at the same revision as you merged the branch into trunk.
If you want to completely overwrite the trunk file with the branched file, you can delete the trunk file and then make a copy of the branch one (easy and radical)
svn delete https://web/trunk/text.cpp -m "delete trunk file"
svn copy https://web/branches/tt_branch/text.cpp
If you want to do something less absolute, try to use the svn merge operation
svn merge https://web/branches/tt_branch/text.cpp https://web/trunk/text.cpp
that will ask you to solve the potential conflicts, if you don't want to resolve any conflicts, try this :
svn merge --accept theirs-full https://web/branches/tt_branch/text.cpp https://web/trunk/text.cpp
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