Cheating Sheet Subversion
Cheating Sheet Subversion
I.
1. Follow the instructions of Google to create your own project under server version repository.
http://code.google.com/hosting/createProject
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.
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