Basic SVN Commands (revision 120912-r05Ki)¶
- SVN import: used to copy our new local directory to a directory in svn server.
- 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.
- 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).
- svn delete: used to inform svn server that we will delete some files that's in svn directory.
- 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.
- In this tutorial we use https://projects.ui.ac.id/svn/os as repository link, while when you click the repository link in projects.ui.ac.id, there is an explanation to checkout from https://kode.poss.or.id/svn/os, will this be different? It is actually just the same, so you may use both links, but for uniformity you are suggested to use projects.ui.ac.id.
- 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]@ui.ac.id -m "Import NPM" [NPM]/ https://projects.ui.ac.id/svn/os/[CLASS]/[NPM]/
As example, I put my NPM directory to TESTING class.
$ svn import --username email@example.com -m "import NPM" 1202000818/ https://projects.ui.ac.id/svn/os/TESTING/1202000818/
replace TESTING with KI140 and 1202000818 with your ID!
- If this is your first import, choose p (permanent) option.
- From your browser, login to projects and look at "Repository tab":: https://projects.ui.ac.id/projects/os/repository, your folder will be recorded in your CLASS folder.
- 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]@ui.ac.id https://projects.ui.ac.id/svn/os/[CLASS]/[student_ID]/ [student_ID]/ $ svn checkout --username firstname.lastname@example.org https://projects.ui.ac.id/svn/os/TESTING/1202000818/ 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]@ui.ac.id -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]@ui.ac.id -m "hapus 3 dan 4" $ ls -F
This marks the end of basic SVN tutorial.