Beginning svn

I had hard time to understand svn, and asked my admin who said I was over thinking and recommend remember the 5~6 commands to do as told. But I am so lost when the situation changed a little bit. For example, I am in my local box under my project folder:

/home/yifangt/svn/ 

where there are two projects dog and fox:

/home/yifangt/svn/dog
/home/yifangt/svn/fox

When I came to the dog project and checkout the project from repository (I believe it is somewhere I am not sure, as my admin told me do not need to think of it!)
Say project dog has two scripts

how_to_hunt_fox.c    how_to_like_cat.c
/home/yifangt/svn/dog $ svn co svn://svn/dog

I got extra subdirectory named dog again,

/home/yifangt/svn/dog/dog/

which is actually redundant of dog from the repository. What I expect is to just check out the two files only, but not the whole folder. What did I miss? What should I do?

Thank you!

It is not possible to check-out just a file (of course you can update/re-base with just a single file while inside a working checked-out sandbox).

At the best you can check out a sub-directory from SVN repository of the project. For this:

Do

 svn info 

and you would get many information printed on the console related to the branch repository.

Amongst them there is an URL of the branch repository you sandbox is created of.

Open IE/Mozill FF or any browser and paste and open the URL.

Here you'd be able to see the files/sub-directories of the project inside the SVN repository. Browse and reach to the directory, you want to check-out. Now look at the URL again and copy that (in simplest terms for you).

And issue the command:

 svn co <https://<theURLYouCopied>> 

However just by browsing repository you'd start getting comfortable with SVN itself. This is my hope :-).

Cheer's and don't worry at all !!

:slight_smile:

1 Like

Thanks Praveen!

Still not clear yet, as my environment seems using svn protocol (not quite sure though), as my admin told me to use

svn co svn://path/something/

But I always got error messages, almost all the time so that I do not know how to start.
Let me start like this: I have two folders csm_at and yifangt under /home/yifangt/svn
I checked there are similar subfolders in each of them, like sources, perl_srcipt, programs etc. Now I want to add a perl script named foo.pl within the perl_script folder under yifangt, how do I start?
Thanks a lot in advance!
YF

You can do:

$ svn add foo.pl

Then,

$ svn commit
1 Like

Thanks Praveen!
Do I need to worry about the project folder perl_script for this file, I mean to include the path? That's one of the parts I feel confused with.
How about if I have the same file in another project e.g: sources but the code is different? Does svn handle that automatically? Thanks a lot!

No, you don't need to worry of the path. Inside the sandbox a folder called .svn gets created and has all the information (including navigational information) the SVN needs to correctly check-in your file.

If you do

 svn commit 

inside a given directory all files and it's sub-folders are tested for changes (if any) and those changed are decided to be checked-in and just before this you get an editor (if already set) opened for you, with already populated with information of the files getting checked-in, to enable you to write your final check-in comments.

You don't need to worry at all. It's just like the directory rule in which you can't have two file with same name but can have under different directories and hence path differs (the absolute path can't be same of two entity under the system).