Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: How to update only the files that were modifed in the revision

Is it possible to update only the files that were affected by the last commit? In one command preferably, on linux.

EDIT:

Example. First i commit files 1 and 2. Then i commit files 3 and 4. Now i want to update only files 3 and 4 without updating 1 and 2.

like image 277
barin Avatar asked Aug 30 '11 11:08

barin


2 Answers

If you like to update particular files you have to give them on command line:

svn update file1.txt file2.txt 

If you wan't it more handy you can write a script to do this..

Update:In the example what you described in your question: you don't need to update the files, cause they are already update based on the commit you did before. So i think you are thinking of a different working copy.

like image 127
khmarbaise Avatar answered Oct 08 '22 01:10

khmarbaise


If you want to update your working copy with only selected commits, you have to merge them in - you're effectively creating a local branch with cherry-picked commits from trunk, although the final update should pick them up OK. You'll want

svn log -l 1 http://remote-repository-url/

to find the revision number you want, then

svn merge -c 12345 http://remote-repository-url/

to merge future commit 12345 into your WC.

Or, if changes are committed in disjoint directories, you can simply

svn update dir-with-changes

to split the revision of your WC and pick up only changes in the named directory.

like image 39
Rup Avatar answered Oct 08 '22 00:10

Rup