svn command line tutorial for beginners 1
April 17th, 2007 mysurface Posted in Developer, svn, svnadmin, svnlook | Hits: 102998 |
svn can be known as subversion, it is a version control system after cvs. It claims to be out perform cvs, one of the features of svn is it do support versioning for documents and binaries beside source code.
As you search for subversion, it may lead you to the page of http://tortoisesvn.tigris.org/. Tortoise is a windows client of svn, you can even create svn repo using tortoise. Tortoise incorporate with windows explorer well, therefore it is easy to use.
When I migrate my svn repository to Linux, I couldn’t find any svn client that as easy as tortoise in windows. I was a bit upset at first. But not more for now, I have learn the way to cope with svn command line. I feel more control on it as in the sense that I know what am I doing by using command line compare to using GUI.
This post is not going to focus on svn installation, as the installation is available anywhere, let me list some links for you in case you are actually looking for installation.
|
|
Subversion Installation References
The aim of this tutorial is to guide beginners for using svn command line with simple examples. As I am newbie as well for now, I urge you to notify me if you find some mistake I have made or you have better techniques to share.
Lets get it started….
How to get help with svn?
If you are looking for svn reference in man pages, you have gone to the wrong place. To check the references of svn commands, simple do this:
svn help
This will make svn list all the available functions, to get the function reference, let say checkout
svn help checkout
The same thing goes to other svn related commands, such as svnadmin
svnadmin help
How to create a svn repository?
First of all what is repository? It is a core file for svn, or you can call it a centralized svn backup database. After created it, it is just a directory with its files. IMPORTANT! Do NOT try to modify or add something into the repository, unless you know what are you doing.
To create a svn repo, let say I wanna create a repo to store all my programming codes, I do this
svnadmin create /home/mysurface/repo/programming_repo
Remember try to use absolute path for everything, sometimes the relative path is not going to work.
How to import my existing directories into the new repo?
svn import /home/mysurface/programming file:///home/mysurface/repo/programming_repo -m "Initial import"
-m stand for log message, the first revision was created with log as “Initial import”. You need to specified URL for the repo, URL is the standard argument for svn. Therefore for local file, you need to specified with file://
How to see what is inside the repo?
svn list file:///home/mysurface/repo/programming_repo
Another way of listing all the files and folder in the tree view, I use svnlook
svnlook tree programming_repo
The difference between svn list and svnlook tree is one expect URL another one do not.
svn command line tutorial for beginners 2 will covers how to checkout, track changes, commit, add or delete files and message logs.
Continue reading next post ….
Live Chat!







April 17th, 2007 at 12:29 am
[...] This is the continues tutorial for svn command line tutorial for beginners 1. The previous post covers Introduction of subversion, installation links, how to get help, create svn repository, import files into a new repository and list the files inside a repo. [...]
April 18th, 2007 at 7:00 pm
[...] surface from Linux by Examples has written two ‘getting started for SVN’ articles that I find it interesting and useful for beginners. [...]
June 6th, 2007 at 1:30 am
The English in this tutorial could do with some editting. I find the grammar errors extremely distracting. I’d be happy to do this.
September 14th, 2007 at 2:28 pm
[...] svn command line tutorial for beginners 1Â Category: Cheatsheets | Comment (RSS) | Trackback [...]
October 9th, 2007 at 12:28 pm
[...] svn command line tutorial for beginners 1 [...]
April 11th, 2008 at 11:39 am
@Arnold-Moore Perhaps this was written with search engines in mind as the English is very broken.
April 12th, 2008 at 3:53 pm
Arnold, Owen:
The English may consider very broken, but yet the message is delivered. English is not my native language (I know the excuses is lame, well I improves my english.) and NO, I do not write for SEO.
April 16th, 2008 at 3:51 am
@mysurface, well it does definitely get the point across. Its a good tutorial!
September 14th, 2008 at 3:45 am
Great tut..thanks
October 21st, 2008 at 4:23 pm
I always forget this, therefore here I make a note.
Let say I have a wanna check in a folder to existing projects into svn. My folder is recv and my svn url is https://svn/projects/mysummer/
I need to use import,
svn import recv https://svn/projects/mysummer/recvOctober 29th, 2008 at 2:06 am
Good one..simple and clean.
December 4th, 2008 at 2:39 pm
Sometimes svn url path may change due to the server relocation etc. To remap back the svn path we can use svn switch –relocate
First check the old url path with svn info next do the switch
svn switch –relocate
i.e.
svn switch --relocate https://udklstr1/SWITCHING/generic/SunManager/trunk https://10.162.24.3/svn/SWITCHING/generic/SunManager/trunkJune 3rd, 2009 at 1:12 pm
good …but i’ve problem while using svnlook tree mydir_name
error: can’t open file svn/format: No such file or Directory, but when I checkin the folder, it is there.
I created a folder name svn in this location /root/Desktop.