Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tech:others:sf_svn [2014/11/15 09:13] (current)
Line 1: Line 1:
 +====== Using Subversion on Sourceforge.net ======
 +Below are the steps to using SVN if you are the developer of projects hosted on sourceforge. This example uses onlinepasswords opensource application that I created and is hosted on sourceforge.
 +
 +====== Resources for Getting Subversion working on Sourceforge.net ======
 +
 +[[http://​alexandria.wiki.sourceforge.net/​Subversion+Client+-+Command-line+SVN+client|To get an Overview of SVN]]
 +
 +[[https://​sourceforge.net/​tracker/​index.php?​func=detail&​aid=2315352&​group_id=1&​atid=200001|Open Issue]]
 +
 +[[https://​sourceforge.net/​project/​admin/​svn.php?​group_id=243130|Onlinepasswords SVN Admin page]]
 +
 +====== Onlinepasswords on Sourceforge.net ======
 +
 +[[https://​onlinepasswords.svn.sourceforge.net/​svnroot/​onlinepasswords|SVN web repository]]
 +
 +[[http://​onlinepasswords.svn.sourceforge.net|SVN Web repository - using ViewVC]]
 +
 +----
 +
 +====== Actual steps to getting SVN working on Sourceforge.net ======
 +My development box is a Linux server and I do most work on command line. So everything is done via command line. You can mimic/tweak this with GUI on either Linux or Windows\\
 +
 +1. Assume all of the source files are in a given folder (on your local server) from where you want to do the import to sourceforge svn. \\
 +
 +This folder name is /​home/​userhomedir/​onlinepasswords. Run this:
 +
 +<code bash>
 +  cd /​home/​userhomedir/​onlinepasswords
 +  ls -la
 +</​code>​
 +
 +Output:
 +<​code>​
 +total 152
 +drwxr-xr-x ​  5 myusername ​ myusername ​     512 Nov 22 21:07 .
 +drwxr-xr-x ​ 55 myusername ​ myusername ​    2048 Nov 23 08:09 ..
 +-rw-r--r-- ​  1 myusername ​ myusername ​    4348 Nov 22 21:07 add.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    6667 Nov 22 21:07 class.hash_crypt.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     889 Nov 22 21:07 delete.gif
 +-rw-r--r-- ​  1 myusername ​ myusername ​     808 Nov 22 21:07 delete.php
 +drwxr-xr-x ​  2 myusername ​ myusername ​     512 Nov 22 21:07 docs
 +-rw-r--r-- ​  1 myusername ​ myusername ​     622 Nov 22 21:07 edit.gif
 +-rw-r--r-- ​  1 myusername ​ myusername ​    3251 Nov 22 21:07 edit.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    1596 Nov 22 21:07 edit1.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     286 Nov 22 21:07 fclear.js
 +-rw-r--r-- ​  1 myusername ​ myusername ​   25079 Nov 22 21:07 flatfile.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    3108 Nov 22 21:07 flatfile_utils.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     481 Nov 22 21:07 index.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     218 Nov 22 21:07 log.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    2125 Nov 22 21:07 login.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     123 Nov 22 21:07 logout.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     455 Nov 22 21:07 menu.php
 +drwxr-xr-x ​  2 myusername ​ myusername ​     512 Nov 22 21:07 protected
 +-rw-r--r-- ​  1 myusername ​ myusername ​    3448 Nov 22 21:07 register.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    3876 Nov 22 21:07 search.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    2433 Nov 22 21:07 styles.css
 +-rw-r--r-- ​  1 myusername ​ myusername ​     497 Nov 22 21:07 wprop.php
 +</​code>​
 +
 +2. Do the import
 +
 +<code bash>
 +cd /​home/​userhomedir
 +myusername@mylocalserver:​ /​home/​userhomedir >
 +svn import onlinepasswords https://​onlinepasswords.svn.sourceforge.net/​svnroot/​onlinepasswords -m initial --username mysfusername
 +</​code>​
 +
 +Output:
 +<​code>​
 +Error validating server certificate for '​https://​onlinepasswords.svn.sourceforge.net:​443':​
 + - The certificate is not issued by a trusted authority. Use the
 +   ​fingerprint to validate the certificate manually!
 +Certificate information:​
 + - Hostname: *.svn.sourceforge.net
 + - Valid: from Tue, 09 Oct 2007 14:15:07 GMT until Mon, 08 Dec 2008 15:15:07 GMT
 + - Issuer: Equifax Secure Certificate Authority, Equifax, US
 + - Fingerprint:​ xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx
 +(R)eject, accept (t)emporarily or accept (p)ermanently?​ p
 +Authentication realm: <​https://​onlinepasswords.svn.sourceforge.net:​443>​ SourceForge Subversion area
 +Password for '​mysfusername':​ <entered sourceforge password>​
 +Adding ​        ​onlinepasswords/​delete.php
 +Adding ​        ​onlinepasswords/​docs
 +Adding ​        ​onlinepasswords/​docs/​index.txt
 +Adding ​        ​onlinepasswords/​docs/​index.html
 +Adding ​ (bin)  onlinepasswords/​edit.gif
 +Adding ​        ​onlinepasswords/​protected
 +Adding ​        ​onlinepasswords/​protected/​readme.txt
 +Adding ​        ​onlinepasswords/​menu.php
 +Adding ​        ​onlinepasswords/​search.php
 +Adding ​        ​onlinepasswords/​flatfile_utils.php
 +Adding ​        ​onlinepasswords/​edit1.php
 +Adding ​        ​onlinepasswords/​index.php
 +Adding ​        ​onlinepasswords/​wprop.php
 +Adding ​        ​onlinepasswords/​login.php
 +Adding ​        ​onlinepasswords/​class.hash_crypt.php
 +Adding ​        ​onlinepasswords/​logout.php
 +Adding ​ (bin)  onlinepasswords/​delete.gif
 +Adding ​        ​onlinepasswords/​fclear.js
 +Adding ​        ​onlinepasswords/​log.php
 +Adding ​        ​onlinepasswords/​register.php
 +Adding ​        ​onlinepasswords/​styles.css
 +Adding ​        ​onlinepasswords/​edit.php
 +Adding ​        ​onlinepasswords/​flatfile.php
 +Adding ​        ​onlinepasswords/​add.php
 +
 +Committed revision 1.
 +</​code>​
 +
 +3. Verify
 +
 +<code bash>
 +myusername@mylocalserver:​ /​home/​userhomedir >
 +svn list https://​onlinepasswords.svn.sourceforge.net/​svnroot/​onlinepasswords
 +</​code>​
 +
 +Output:
 +<​code>​
 +Error validating server certificate for '​https://​onlinepasswords.svn.sourceforge.net:​443':​
 + - The certificate is not issued by a trusted authority. Use the
 +   ​fingerprint to validate the certificate manually!
 +Certificate information:​
 + - Hostname: *.svn.sourceforge.net
 + - Valid: from Tue, 09 Oct 2007 14:15:07 GMT until Mon, 08 Dec 2008 15:15:07 GMT
 + - Issuer: Equifax Secure Certificate Authority, Equifax, US
 + - Fingerprint:​ xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx
 +(R)eject, accept (t)emporarily or accept (p)ermanently?​ p
 +add.php
 +class.hash_crypt.php
 +delete.gif
 +delete.php
 +docs/
 +edit.gif
 +edit.php
 +edit1.php
 +fclear.js
 +flatfile.php
 +flatfile_utils.php
 +index.php
 +log.php
 +login.php
 +logout.php
 +menu.php
 +protected/
 +register.php
 +search.php
 +styles.css
 +wprop.php
 +myusername@mylocalserver:​ /​home/​userhomedir >
 +</​code>​
 +
 +4. Delete the directory from which the import was done.  This is where we are going to create the working copy.  You can just choose a difference location if required. Why are we doing this? Because I am moving sourceforge to be my main repository and make my local as the client which will have the files from svn.  So sourceforge will maintain my project files going forward and I don't have to trust my backups!
 +
 +<​code>​
 +cd /​home/​userhomedir
 +myusername@mylocalserver:​ /​home/​userhomedir >
 +rm -Rf onlinepasswords
 +</​code>​
 +
 +5. Create a working copy directory and downloading the files that were just uploaded
 +
 +<code bash>
 +cd /​home/​userhomedir
 +svn checkout https://​onlinepasswords.svn.sourceforge.net/​svnroot/​onlinepasswords onlinepasswords
 +</​code>​
 +
 +Output:
 +<​code>​
 +Error validating server certificate for '​https://​onlinepasswords.svn.sourceforge.net:​443':​
 + - The certificate is not issued by a trusted authority. Use the
 +   ​fingerprint to validate the certificate manually!
 +Certificate information:​
 + - Hostname: *.svn.sourceforge.net
 + - Valid: from Tue, 09 Oct 2007 14:15:07 GMT until Mon, 08 Dec 2008 15:15:07 GMT
 + - Issuer: Equifax Secure Certificate Authority, Equifax, US
 + - Fingerprint:​ xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx:​xx
 +(R)eject, accept (t)emporarily or accept (p)ermanently?​ p
 +A    onlinepasswords/​delete.php
 +A    onlinepasswords/​docs
 +A    onlinepasswords/​docs/​index.txt
 +A    onlinepasswords/​docs/​index.html
 +A    onlinepasswords/​protected
 +A    onlinepasswords/​protected/​readme.txt
 +A    onlinepasswords/​edit.gif
 +A    onlinepasswords/​menu.php
 +A    onlinepasswords/​search.php
 +A    onlinepasswords/​edit1.php
 +A    onlinepasswords/​flatfile_utils.php
 +A    onlinepasswords/​wprop.php
 +A    onlinepasswords/​index.php
 +A    onlinepasswords/​class.hash_crypt.php
 +A    onlinepasswords/​login.php
 +A    onlinepasswords/​logout.php
 +A    onlinepasswords/​delete.gif
 +A    onlinepasswords/​fclear.js
 +A    onlinepasswords/​log.php
 +A    onlinepasswords/​register.php
 +A    onlinepasswords/​styles.css
 +A    onlinepasswords/​edit.php
 +A    onlinepasswords/​flatfile.php
 +A    onlinepasswords/​add.php
 +Checked out revision 1.
 +</​code>​
 +
 +<​code>​
 +cd onlinepasswords
 +myusername@mylocalserver:​ /​home/​userhomedir/​onlinepasswords >
 +ls -la
 +</​code>​
 +
 +Output:
 +<​code>​
 +total 152
 +drwxr-xr-x ​  5 myusername ​ myusername ​     512 Nov 23 08:21 .
 +drwxr-xr-x ​ 55 myusername ​ myusername ​    2048 Nov 23 08:21 ..
 +drwxr-xr-x ​  6 myusername ​ myusername ​     512 Nov 23 08:21 .svn
 +-rw-r--r-- ​  1 myusername ​ myusername ​    4348 Nov 23 08:21 add.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    6667 Nov 23 08:21 class.hash_crypt.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     889 Nov 23 08:21 delete.gif
 +-rw-r--r-- ​  1 myusername ​ myusername ​     808 Nov 23 08:21 delete.php
 +drwxr-xr-x ​  3 myusername ​ myusername ​     512 Nov 23 08:21 docs
 +-rw-r--r-- ​  1 myusername ​ myusername ​     622 Nov 23 08:21 edit.gif
 +-rw-r--r-- ​  1 myusername ​ myusername ​    3251 Nov 23 08:21 edit.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    1596 Nov 23 08:21 edit1.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     286 Nov 23 08:21 fclear.js
 +-rw-r--r-- ​  1 myusername ​ myusername ​   25079 Nov 23 08:21 flatfile.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    3108 Nov 23 08:21 flatfile_utils.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     481 Nov 23 08:21 index.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     218 Nov 23 08:21 log.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    2125 Nov 23 08:21 login.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     123 Nov 23 08:21 logout.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​     455 Nov 23 08:21 menu.php
 +drwxr-xr-x ​  3 myusername ​ myusername ​     512 Nov 23 08:21 protected
 +-rw-r--r-- ​  1 myusername ​ myusername ​    3448 Nov 23 08:21 register.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    3876 Nov 23 08:21 search.php
 +-rw-r--r-- ​  1 myusername ​ myusername ​    2433 Nov 23 08:21 styles.css
 +-rw-r--r-- ​  1 myusername ​ myusername ​     497 Nov 23 08:21 wprop.php
 +</​code>​
 +
 +
 +5. Check for updates (there will be none!)
 +
 +<​code>​
 +myusername@mylocalserver:​ /​home/​userhomedir/​onlinepasswords >
 +svn update
 +</​code>​
 +Output:
 +<​code>​
 +At revision 1.
 +</​code>​
 +
 +
 +6. Undoing Working Changes
 +
 +<​code>​
 +myusername@mylocalserver:​ /​home/​userhomedir/​onlinepasswords >
 +<edit add.php and make some changes>
 +svn revert add.php
 +</​code>​
 +
 +Output:
 +<​code>​
 +Reverted '​add.php'​
 +</​code>​
 +
 +7. Other operations
 +
 +The typical work cycle looks like this:
 +
 +Update your working copy.
 +
 +    svn update
 +
 +Make changes.
 +
 +    svn add
 +    svn delete
 +    svn copy
 +    svn move
 +
 +Examine your changes.
 +
 +    svn status
 +    svn diff
 +
 +Possibly undo some changes.
 +
 +    svn revert
 +
 +Resolve conflicts (merge others'​ changes).
 +
 +    svn update
 +    svn resolve
 +
 +Commit your changes.
 +
 +    svn commit
  

QR Code
QR Code tech:others:sf_svn (generated for current page)