Subversion
- 20/08/2009
Subversion (SVN) - In practice ...
Well, now who did not understand what's this SVN can already start using this feature. Who has not read the introductory post is interesting to read before continuing.
Hands on!
To facilitate understanding, we will use SVN in Windows first. We will use him in conjunction with a tool called TortoiseSVN . You remember the commands that I said in previous post?
- checkout
- update
- commit
TortoiseSVN is a program that abstracts the commands listed above (and many others) that interact with the SVN is all with the mouse. To download the TortoiseSVN go to the following address: http://tortoisesvn.net/downloads
As it is integrated with Windows Explorer, you must restart Windows after installation ![]()
Let's do the following steps described in the previous post and add others:
- Checkout: You already know what it is.
- commit: You already know what it is.
- update: You already know what it is.
- see the log of commits: See a list of modified files in each commit done.
- see a diff: See the difference with a local file repository.
To perform these steps, I created a test repository.
- Repository URL: http://marcelosabadini.com.br/svn_blog
- User: usuario_blog
- Password: teste123
So, first let's take the source repository. Just click the right mouse button on a folder and choose "SVN Checkout ..." as the image below:
A screen to tell what is the address of reposotório:
In the "URL of repository" you will say: http://marcelosabadini.com.br/svn_blog
In the "Checkout Depth" will tell you which folder the files are downloaded, note that it loads with the folder in which you clicked the right button.
Then click OK, you are prompted for user name and password:
It will download the files and display the screen below:
Now, when you look at the folder with the files, you will notice that it was different Icode:
He realized that the folder icon and the file has changed?
Well, now we can already make the necessary changes in the source file. I made a change just to test, see how the folder and file were:
That is, only through the eye of ja to realize that the local source is different from that in the source repository. When all changes are made, it's time to send them. Right-click on the folder that is under version control and choose "SVN Commit":
Will load a screen with all the files that have changed / created / deleted. You will mark the 'checkbox' of the files you want to commit and click OK.
Remember that a good practice to use SVN is always put in a commit message that will be given. Since this facilitates return to a specific review! For example, if you change something that ends up breaking the system, you will pass the eye and see that the revision changed the twentieth such a configuration.
When the files are sent, a summary will be displayed:
Well, what else is usually done is that you've seen so far. Now I'll show you some tools that are useful to assist the work.
Let's see the list of commits made to the repository, right-click on the folder, choose the menu "TortoiseSVN / Show Log", see the window that opens:
Another useful tool is the DIFF. With it, you can compare two files ... copy this on your machine with the copy that is in the repository. Click on a file that was changed on your machine (remember the image with red?) And choose the the option "TortoiseSVN / DIFF", see image below:
A nice exercise for you to do is download the source test, do some modificões, see the diff and commit something.
I hope I have been very objective and clear! if I forget something or want to add something please feel free to comment!
A big hug!













