Sie sind auf Seite 1von 20

Version Control with Subversion Client Commands

Sunlux Technologies Ltd., 2011

What and Why


Subversion uses a client-server model Is for tracking changes to code and documents

Changes are stored as revisions


It is possible to retrieve back a previous version or revision of a file
Sunlux Technologies Ltd. | 2011

Commit and Update


Central Repository

Commit

Update

Metadata Working Directory

Metadata Working Directory

Sunlux Technologies Ltd. | 2011

Usage Commands
Type the below command to install subversion on your Ubuntu machine sudo apt-get install subversion

After the installation now you can start


using svn from your terminal

Sunlux Technologies Ltd. | 2011

Basic Work Cycle


Update your working copy $ svn update Commit your changes. svn commit

Make changes $ svn add $ svn delete $ svn copy $ svn move

Sunlux Technologies Ltd. | 2011

Basic Work Cycle

Examine your changes svn status svn diff

Possibly undo some changes svn revert

Resolve conflicts (merge others' changes) svn update svn resolve

Sunlux Technologies Ltd. | 2011

Extra Functions you might want


svn log Shows you broad information: log messages with date and author information attachedto revisions and which paths changed in each revision svn diff Shows linelevel details of a particular change svn cat Retrieves a file as it existed in a particular revision number and displays it on your screen svn list Displays the files in a directory for any given revision

Sunlux Technologies Ltd. | 2011

What is SVN Checkout?


Checkout is used for having a working local copy of a file in the SVN repo $ svn checkout http://svn.example.com/repos/calc A calc/Makefile A calc/integer.c

A calc/button.c
Checked out revision 56. $ ls -A calc Makefile button.c integer.c .svn/
Sunlux Technologies Ltd. | 2011

What is SVN Commit?


To publish your new changes to others
$ svn commit button.c -m "Fixed a typo in button.c. Sending button.c Transmitting file data . Committed revision 57.
Sunlux Technologies Ltd. | 2011

What is SVN Update?


To acquire the latest version of a file from the repository $ svn update

U button.c
Updated to revision 57.
Sunlux Technologies Ltd. | 2011

What is SVN Diff?


SVN Diff lets you examine your changes $ svn diff

Sunlux Technologies Ltd. | 2011

What is SVN Revert?


SVN Revert lets you discard the changes that you have made to the local copy $ svn revert filename

Sunlux Technologies Ltd. | 2011

What is SVN Log?


$ svn log -r 5:19 shows logs 5 through 19 in chronological order

Sunlux Technologies Ltd. | 2011

What is SVN List?


$ svn list http://svn.collab.net/repos/svn This will list the file under the directory svn in the SVN Repo repos

Sunlux Technologies Ltd. | 2011

What is SVN Cat?


$ svn cat -r 2 rules.txt This will display the content in the file rules.txt of the revision 2

Sunlux Technologies Ltd. | 2011

This could happen to you


While you try to update your working copy, you might encounter conflicts
$ svn update U INSTALL G README Conflict discovered in 'bar.c'. Select: (p) postpone, (df) diff-full, (e) edit, (h) help for more options:

Sunlux Technologies Ltd. | 2011

Conflicts Options Explained


(p)ostpone - Leave the file in a conflicted state for you to resolve after your update is complete. (d)Iff - Display the differences between the base revision and the conflicted file itself in unified diff format. (e)Dit - Open the file in conflict with your favorite editor, as set in the environment variable editor. (r)esolved - After editing a file, tell svn that you've resolved the conflicts in the file and that it should accept the current contentsbasically that you've resolved the conflict.

Sunlux Technologies Ltd. | 2011

Conflicts Options Explained


(m)ine-(f)ull - Discard the newly received changes from the server and use only your local changes for the file under review.

(t)heirs-(f)ull - Discard your local changes to the file under review and use only
the newly received changes from the server. (l)aunch - Launch an external program to perform the conflict resolution. This requires a bit of preparation beforehand. (h)elp - Show the list of all possible commands you can use in interactive conflict resolution.

Sunlux Technologies Ltd. | 2011

Need some help?


SVN is a self-documenting application If you ever need any help in using svn sub-commands $ svn help sub-command

Sunlux Technologies Ltd. | 2011

Sunlux Technologies Ltd. | 2011

Das könnte Ihnen auch gefallen