Basic SVN Commands (revision 120912-r05Ki)

Return to Lab 01

  1. SVN import: used to copy our new local directory to a directory in svn server.
  2. SVN checkout: used to copy the directory in svn server within the last revision (or you may choose which revision you want to use) to our local directory.
  3. svn add: used to inform svn that we will add new files/folders in a directory that is connected to svn (for example, directory that we use for svn checkout before).
  4. svn delete: used to inform svn server that we will delete some files that's in svn directory.
  5. svn commit: used to confirm to svn server to do the changes (such as svn add and svn delete) and create a new revision based on the changes made.
  6. In this tutorial we use as repository link, while when you click the repository link in, there is an explanation to checkout from, will this be different? It is actually just the same, so you may use both links, but for uniformity you are suggested to use
  7. ls -F: used to append indicator (one of */=>@|) to entries.

Pre-requisite: Tutorial Basic Linux Commands

  • Redirect to kuliahos directory at /extra.
    $ cd /extra/kuliahos/
  • Create Lab01 directory inside your Student_ID directory. For example my ID is 1202000818
    $ mkdir 1202000818/Lab01
  • Let's import our student_ID directory to SVN repository. Change [CLASS] to KI140 and [NPM] to your student ID.
    $ svn import --username [your_username] -m "Import NPM" [NPM]/[CLASS]/[NPM]/

    As example, I put my NPM directory to TESTING class.
    $ svn import --username -m "import NPM" 1202000818/

    replace TESTING with KI140 and 1202000818 with your ID!
  • If this is your first import, choose p (permanent) option.
  • Exit from kuliahos directory and delete it. Now create a new CLASS folder. Inside CLASS folder, make your student_ID folder.
    $ cd ..
    $ rm -rf kuliahos/
    $ mkdir TESTING/ TESTING/1202000818/
    $ cd TESTING/

    Replace TESTING with KI140 and 1202000818 with your ID!
  • Do a checkout of your previously imported folder into this new folder.
    svn checkout --username [your_username][CLASS]/[student_ID]/ [student_ID]/
    $ svn checkout --username 1202000818/

  • Get into Lab01 directory. Create 4 new directories, add the directories to SVN and commit your work.
    $ cd [your_ID]/Lab01/
    $ mkdir test1 test2 test3 test4
    $ ls -F
    $ svn add test1 test2 test3 test4
    $ svn commit --username [your_username] -m "add 4 dirs"
  • Fill in your password, then type 'no' for the question "Store password unencrypted?(yes/no)". Mark your revision no. (Commited Revision Z).
  • Now we want to delete test3 and test4 directories from SVN.
    $ svn delete test3 test4
    $ svn commit --username [your_username] -m "hapus 3 dan 4" 
    $ ls -F

This marks the end of basic SVN tutorial.

Return to Lab 01
Return to Wiki