Showing posts with label svn. Show all posts
Showing posts with label svn. Show all posts

SVN : Merge a branch back into the trunk

How to copy a branch called V2 into the trunk :

I. find the first revision "V2"

in V2 directory type :
[pene@donunix] svn log --stop-on-copy

note the latest revision number displayed (for us it's 270)

II. find the latest V2 revision

in V2 directory type :
[pene@donunix]svn up

note the revision number displayed (for us it's 1603)

III. merge the branch into the trunk

in V2 directory type :
[pene@donunix]svn merge -r270:1603 https://my.svn.server/path/code/branch/V2

and commit:
[pene@donunix]svn ci -m "Merge V2 branch back into the trunk"

SVN : How to restore an older version of my current file ?

I want to restore an older version (from the SVN revision number 1289) of my current file fic.pl, what can I do ? 

Here is the tips (NB my current revision is 1492) :

[npene@donunix] svn merge -r 1492:1289 fic.pl

SVN : remove all deleted files

Hi folks,
Today a new Subversion tips: How to remove from the SVN base deleted files (by rm command).

[pene@donunix] svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %

[SVN] Add Recursively

Here is the command to add recursively new files in Subversion :

[pene@donunix] svn status | grep '^\?' | sed -e 's/^? *\(.*\)/\1/;s/ /\\ /g' | xargs svn add

[svn] file : restore older versions

To restore the version of the file.sh from the lastest commit, type this :
[pene@donunix] svn revert file.sh

To get the version form the release number 214 :
[pene@donunix] svn update -r 214 file.sh

Import a new project to Subversion

Before all, you have to create thoses directories :
[pene@donunix] mkdir -p origin/branches origin/tags origin/trunck

then copy your project in the origin/trunk directory :
[pene@donunix] cp -r myproject/* origin/trunk

And to finish, import the project to your subversion base :
[pene@donunix] svn import origin https://svn.b11.fr/svnroot/ -m 'initial version'