Changes between Initial Version and Version 1 of cypress/Programming/Svn)


Ignore:
Timestamp:
05/15/15 11:49:49 (10 years ago)
Author:
cmaggio
Comment:

migrated content from ccs wiki

Legend:

Unmodified
Added
Removed
Modified
  • cypress/Programming/Svn)

    v1 v1  
     1= Version Control with Subversion (svn) =
     2== What is SVN? ==
     3* A free/open-source version control system.
     4* Managing files and directories over time, placed into a central repository.
     5* The repository remembers every changes ever made to the files and directories.
     6* Accessible across networks, allowing to be used on different computers.
     7* Runs on Many platforms.
     8[[http://subversion.apache.org/|Home Page]]
     9
     10SVN model.png
     11
     12== Good things... ==
     13* If you develop a software with some other people, it keeps track of who did what when and where changes.
     14  * even if you develop a software yourself...
     15* When you made a stupid change and screwed up ....
     16  *Allows you to go back.
     17  *Revert to a previous revision of a file/directory.
     18
     19SVN revision.png
     20
     21== First things to do ==
     22* Create a repository on sphynx
     23{{{
     24svnadmin create $HOME/repos
     25}}}
     26This creates a repository under '$HOME/repos'.
     27
     28Note that $HOME is your home-directory on sphynx.
     29
     30Once you did this, you don't have to do this again. Do not delete '$HOME/repos' !!!
     31  * Testing your repository
     32On sphynx,
     33{{{
     34mkdir mywork
     35cd mywork
     36mkdir project1
     37echo "This is README.txt" > README.txt
     38svn import file:///$HOME/repos/project1 -m"initial import"
     39}}}
     40Now you have ''project1'' in your repository.
     41
     42Delete ''project1'' then checkout project1 from the repository,
     43{{{
     44cd ..
     45rm -rf project1
     46svn co file:///$HOME/repos/project1 ./project1
     47}}}
     48
     49== Working with SVN ==
     50* To download files in a repository, use 'svn checkout' / 'svn co' command.
     51* If you made some changes to the files in your local machine and want to upload these to the repository, use 'svn commit' command.
     52* If you have files on your local machine and want to update these to the latest version in the repository, use 'svn update' command.
     53* If you want to add a file/direcotry, use 'svn add' and commit.
     54* If you want to delete a file/directory, use 'svn delete' and commit.
     55
     56== What to Control ==
     57* Source Code
     58* Documents
     59* Variable data
     60* Anything you want to share that isn't essentially static data.
     61
     62'''Do not upload.... Large sets of binary files; images, movie, music....'''
     63
     64== Accessing your Repository over Network ==
     65To access your Repository on sphynx' through ssh from other hosts,
     66
     67{{{
     68svn co svn+ssh://USERNAME@sphynx.ccs.tulane.edu/HOME_DIRCTORY/repos/project1 ./project1
     69}}}
     70
     71You will be asked for typing your password on sphynx.
     72
     73USERNAME and HOME_DIRCTORY are your login user name and home directory on sphynx.
     74
     75To see the path of your home directory, on sphynx
     76{{{
     77cat $HOME
     78}}}
     79* Using svn-client software with GUI
     80  * There are Windows Versions and Mac OS versions.
     81    *[[http://svn-ref.assembla.com/windows-svn-client-reviews.html| Client Software Review]]
     82
     83== Try using Your Repository ==
     84=== Check out data ===
     85Somewhere on sphynx,
     86{{{
     87svn co file:///$HOME/repos/project1 ./project1
     88}}}
     89
     90go into '''project1''' directory.
     91{{{
     92cd project1
     93}}}
     94
     95look at files
     96{{{
     97ls
     98}}}
     99
     100=== Edit README.txt ===
     101Edit '''README.txt''' to add your message.
     102
     103then commit it.
     104{{{
     105svn commit -m"your message"
     106}}}
     107
     108=== When you made a stupid change or delete a file by mistake ===
     109You can revert to a previous version.
     110
     111To look at the log
     112
     113{{{
     114svn log
     115}}}
     116
     117If you want to download version 1,
     118{{{
     119svn -r 1 update
     120}}}
     121
     122When you delete '''README.txt''' by mistake,
     123
     124{{{
     125rm README.txt
     126}}}
     127See the file you deleted does not exist.
     128{{{
     129ls
     130}}}
     131Download the missing file,
     132{{{
     133svn update
     134}}}
     135
     136=== Add files ===
     137Make a new file, then add it to svn by
     138{{{
     139svn add NEW_FILE_YOU_MADE
     140}}}
     141then
     142{{{
     143svn commit -m"your message"
     144}}}
     145=== Check status ===
     146To check the status
     147{{{
     148svn stat
     149}}}
     150
     151To see the difference between the repository and your working version
     152{{{
     153svn diff
     154}}}
     155
     156=== Upload ==
     157To upload your working version to the repository,
     158{{{
     159svn commit -m"comment for current version"
     160}}}
     161
     162Look at the status and difference
     163{{{{
     164svn stat
     165svn diff
     166}}}
     167=== Help ===
     168{{{
     169svn help
     170}}}