0% found this document useful (0 votes)
33 views

Cheating Sheet Subversion

This document provides instructions for using Subversion for personal version control of projects hosted on Google Code. It outlines how to: 1. Create an initial repository on Google Code and import a project. 2. Setup a local working copy through checkout and use daily workflows of updating and committing changes. 3. Provides commands for common version control tasks like adding, removing, copying files as well as resolving conflicts.

Uploaded by

HU Jun
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Cheating Sheet Subversion

This document provides instructions for using Subversion for personal version control of projects hosted on Google Code. It outlines how to: 1. Create an initial repository on Google Code and import a project. 2. Setup a local working copy through checkout and use daily workflows of updating and committing changes. 3. Provides commands for common version control tasks like adding, removing, copying files as well as resolving conflicts.

Uploaded by

HU Jun
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

15/09/2011 by HU Jun

Google Project Hosting Subversion Cheating Sheet


http://code.google.com/hosting/
INTRODUCTION Since its Merge design choice, Subversion is not recommended as a multi-users version control system. This tutorial dedicates the personal usage of Subversion under linux only. Subversion system is a centralized version control system, along with the central server version copy is your proper working version copy.

I.

Create initial repository

1. Follow the instructions of Google to create your own project under server version repository.
http://code.google.com/hosting/createProject

2. Quick import: import my_any_project_tree to repository


$ svn import my_project_tree_directory https://PROJECT.googlecode.com/svn/trunk/ yourDirectory --username your-user-name -m "initial import from unversioned project floder" Adding Adding Adding Adding Adding Committed revision 1. Multimedia3.2/Service.cpp Multimedia3.2/Channel.cpp Multimedia3.2/data1.1txt Multimedia3.2/Flow.h Multimedia3.2/Cell.cpp Skipped 'Multimedia3.2/.svn'

check list after importing


$svn list https://xq-mm-svn.googlecode.com/svn/trunk/ yourDirectory --username youruser-name

3. Create your working version (checkout working copy from repository) on your personal computer:
svn checkout https://PROJECT.googlecode.com/svn/trunk/yourDirectory --username username
It will create a directory named yourDirectory under your execution directory.

II.

Daily working flow

Synchronize your working version with server version Do your modifications Submit your working version to server III. Frequently used commands 1. Update your working copy. svn update

15/09/2011 by HU Jun

2.

3.

4. 5.

6.

-- synchronize your working version with server version svn up Make changes. -- add new files into your working version svn add filename -- remove current file from your working version svn remove filename svn delete svn copy svn move Examine your changes. -- verify the status of your files in the working directory svn status svn diff Possibly undo some changes. -- recover file as the one in current server version svn revert filename Resolve conflicts (merge others' changes). svn update svn resolve Commit your changes. -- submit your working version to server svn commit/svn ci -m some comments Management tricks

IV.

1. Create a tag (a snapshot of your current version) It is wise that if a working version is stable...
svn cp https://PROJECT.googlecode.com/svn/trunk/yourDirectory https://PROJECT.googlecode.com/ svn/tags/TAG/

2. Resolve conflicts APPENDIX I a. The structure of your repository branches Your branch projects trunk Your current version tags The snapshots of your previous versions b. Behind the firewall If youre behind the firewall, the configure file need to be modified. The location of the configure file is: /home/yourname/.subversion/servers The following proxy settings need to be modified under the section [global]:
[global] http-proxy-host = proxyname http-proxy-port = portnumber http-proxy-username = username

15/09/2011 by HU Jun

http-proxy-password = password

APPENDIX II I. other command in svn: svn copy foo bar Create a new item bar as a duplicate of foo and automatically schedule bar for addition. When bar is added to the repository on the next commit, its copy history is recorded (as having originally come from foo). svn copy does not create intermediate directories unless you pass the --parents option. svn move foo bar This command is exactly the same as running svn copy foo bar; svn delete foo. That is, bar is scheduled for addition as a copy offoo, and foo is scheduled for removal. svn move does not create intermediate directories unless you pass the --parents option. svn mkdir blort This command is exactly the same as running mkdir blort; svn add blort. That is, a new directory named blort is created and scheduled for addition. REFERENCE 1: http://svnbook.red-bean.com/en/1.5/index.html

You might also like