Using Tortoise SVN at broader level

17 Jan

Hello folks,

Today we are going to have a look on Using Tortoise SVN at broad level.

Assuming you already have tortoise SVN installed on your machine.
You can use it on your local machine with repository in some folder and working on some other folder. Repository can be on other server also (Just the difference in the URL which repository you are going to use – you will get to know about this here down in this blog)

Repository is where your code files/files revisions/comments are maintained.

This blog tells you about using SVN repository and SVN project on same machine. SVN project is the projects development copy on your machine.

Creating a repository

Creating a repository

Steps to create repository.
Go to say D:\
1. Create folder with the name of your project name. Say “myproject”.
2. Go in that directory and right click.
3. Choose TortoseSVN → Create repository here
4. Repository is created.

You are done with creating repository on your local machine. And repository path is file:///D:/myproject/

If you create repository on some other machine then you need to use that path. It is recommend to create repository on other machine as it is always safe.

SVN Checkout

SVN Checkout

Using repository created in above steps.
1. Create folder where you want to create your projects development copy (says C:\xampp\htdocs\drupal).
2. Right click on this folder created at above step and Select SVN checkout…
3. Enter URL of repository as → file:///D:/myproject/
In our case we are using above local path as repository is created on local machine only. If repository is created on some other machine in the network then that path needs to be used.
Select Fully recursive from drop down for checkout depth.
4. Click OK
5. Your development copy is ready. Now start adding files in C:\xampp\htdocs\drupal

 

Adding a file in repository

Adding a file in repository

How to add files in repository?
1. Create file in your project you want to add in repository (So far this file is not added in the repository so it will come with ? Icon – right click and refresh if you don’t see ? icon)
2. Right click on the file and select TortoiseSVN → Add.
3. Refresh
4. This file will come with + icons → meaning, file is added but not yet committed to the repository.
5. Right click on the file
Select SVN Commit…
6. File is added and committed to the repository.
7. Refresh

Now this file will have green check mark → meaning, file is identical with the same file in repository.

After commit

After commit

Commiting a file

Committing a file

Changing file content and committing to repository
If you want to change code in some file.

1. Right click on the file and select SVN Update. Updating is necessary before commit because you never know some other developer is working on that file.

Updating means taking changes committed by other developer in your copy.

2. Add you code in that file.

3. Right click on the file and select SVN commit.

This will commit your changes in the repository so when other developers take updates for that file they will get updated file with your code in it.

This way you are not overriding another developers code.

Key line is “Always SVN Update a file before SVN Commit”.

SVN update and SVN commit options are available when you right click on the file. You can do these actions on folder level also.

Thank you

Sachin

No comments yet

Leave a Reply

*