Difference between revisions of "Svn"

From Colettapedia
Jump to navigation Jump to search
Line 32: Line 32:
 
#* svn status
 
#* svn status
 
#* svn diff
 
#* svn diff
 +
#** svn diff > patchfile
 
# Possibly undo some changes.
 
# Possibly undo some changes.
#* svn revert
+
#* svn revert = blow your crappy shit away and get back to a clean copy
 +
#** use to undo any scheduled operations, including add
 
# Resolve conflicts (merge others' changes).
 
# Resolve conflicts (merge others' changes).
 
#* svn update
 
#* svn update

Revision as of 19:32, 23 October 2009

General

  • Unlike most version control systems, Subversion's revision numbers apply to entire trees, not individual files.
  • Recommended to have three directories in the repository
    • a trunk directory to hold the “main line” of development
    • a branches directory to contain branch copies
    • and a tags directory to contain tag copies.

Getting Started

  • svn help <command>
  • svn admin create /var/svn/newrepos
  • svn import mytree file:///var/svn/newrepos/some/project -m "Initial Import"
  • svn list file:///var/svn/newrepos/some/project
  • svn checkout [repository location] {[new name of local directory]}
  • svn checkout http://svn.example.com:9834/repos/trunk/some/project
  • svn checkout file:///var/svn/repos
  • svn checkout file://localhost/var/svn/repos
  • svn commit button.c -m "Fixed a typo in button.c."
  • svn update
  • svn status --verbose
  • svn log = display the history of changes to a file or directory

typical work cycle

  1. Update your working copy.
    • svn update
  2. Make changes.
    • svn add
    • svn delete
    • svn copy foo bar = Create a new item bar as a duplicate of foo and automatically schedule bar for addition
    • svn move foo bar = svn copy foo bar; svn delete foo
    • svn mkdir blort = mkdir blort; svn add blort
  3. Examine your changes.
    • svn status
    • svn diff
      • svn diff > patchfile
  4. Possibly undo some changes.
    • svn revert = blow your crappy shit away and get back to a clean copy
      • use to undo any scheduled operations, including add
  5. Resolve conflicts (merge others' changes).
    • svn update
    • svn resolve
  6. Commit your changes.
    • svn commit

Letters

  •  ? - not under version control
  • A - add
  • C - file has textual conflicts from an update
  • U - file was just updated
  • D - file is scheduled for deletion
  • M - file has local modificaations