Subversion: Difference between revisions

From miki
Jump to navigation Jump to search
No edit summary
Line 22: Line 22:
To page the output, use <code>| less -R</code>
To page the output, use <code>| less -R</code>
</ul>
</ul>

== Workflows ==
=== Branch integration ===
From [http://stackoverflow.com/questions/102472/subversion-branch-reintegration]:

* Create a new branch off the trunk
* Work on the branch
* Merge (reintegrate) the branch into trunk
<source lang=bash>
cd trunk
svn merge --reintegrate ^/branches/topic
svn commit
# Committed revision 555.
# # this revision is ^^^^ important
</source>
* From now on:
** Either delete the branch
<source lang=bash>
svn rm ^/branches/topic
</source>
** Or merge trunk back to the branch so that '''subsequent merges do not generate conflicts'''.<br/>This steps is necessary to tell svn that it should ignore the merged revision on the trunk at the next branch reintegration):
<source lang=bash>
cd branches/topic
svn merge --record-only -c 555 ^trunk
svn commit
</source>


== Examples ==
== Examples ==

Revision as of 13:57, 15 December 2011

References

Configuration

  • Colored diff — Either define colordiff as diff-cmd in ~/.subversion/config:
  • diff-cmd = colordiff
    

    However, to keep the internal svn diff tool, you need to define your own function & alias. This will also highlight diff header in green:

    function svnwrap()
    {
        if [ "$1" = "diff" ] ; then
    		"svn" "$@" | colordiff | less -FRX
    	else
    		"svn" "$@"
    	fi
    }
    alias svn=svnwrap
    

    To page the output, use | less -R

Workflows

Branch integration

From [1]:

  • Create a new branch off the trunk
  • Work on the branch
  • Merge (reintegrate) the branch into trunk
cd trunk
svn merge --reintegrate ^/branches/topic
svn commit
# Committed revision 555. 
# # this revision is ^^^^ important
  • From now on:
    • Either delete the branch
svn rm ^/branches/topic
    • Or merge trunk back to the branch so that subsequent merges do not generate conflicts.
      This steps is necessary to tell svn that it should ignore the merged revision on the trunk at the next branch reintegration):
cd branches/topic
svn merge --record-only -c 555 ^trunk
svn commit

Examples

  • Checking out a project
svn co svn+ssh://ftp.noekeon.org/opt/www/daemenj/web/private/SVN/Keccak