You are on page 1of 18

SVN-Client

-Introduction

d A
in o
:V
By
Agenda


SVN-Introduction

SVN-Client Installation

SVN Life Cycle

Introduction
Version Control System (VCS) is a software
that helps software developers to work
together and maintain a complete history of
their work.

It lets user:

To work simultaneously on same
file/project

Prevent overwriting of each other’s
changes

Maintain history of every changes
(as version) of everything
Introduction

VCS primarly divided into two categories:


Centralized Version Control System (CVCS), and
Distributed/Decentralized Version Control System
(DVCS).
we will concentrate only on the Centralized Version
Control System and especially Subversion.
Subversion falls under centralized version control
system, meaning that it uses central server to
store all files and enables team collaboration.
Project Directory Structure
every Subversion project has trunk, tags, and
branches directories directly under the project's
root directory.

The trunk is a directory where all the main
development happens and is usually checked out
by the developers to work on the project.

The tags directory is used to store named
snapshots of the project. When creating a
production release, the team will tag the code
that goes into the release.

The branches directory is used when you want to
pursue different lines of development.
SVN Command
[localhost@vinod] svn help
usage: svn <subcommand> [options] [args]
Type 'svn help <subcommand>' for help on a
specific subcommand.
Most subcommands take file and/or directory
arguments, recursing
on the directories. If no arguments are
supplied to such a
command, it recurses on the current directory
(inclusive) by default.
Mostly Used Commands

add

cat •
resolve

checkout •
resolved

commit •
revert

Delete (del, remove,rm) •
status

diff (di)

info

switch

list (ls)

lock

log •
unlock

merge •
update

mergeinfo •
upgrade

makedir
‘checkout (co)’ command
As a new user,you will be given login
credentials by IT Administrator along with the
link path or IP Address.
Checkout command is used to download
sources from SVN repository to working copy
(the source code directory copy downloaded
onto user machine is known as working copy).
If you want to access files from the SVN server,
checkout is the first operation you should
perform.
‘checkout (co)’ -contd
SVN checkout creates the working copy, from where
you can do edit, delete, or add contents. You can
checkout a file, directory, trunk or whole project. To
checkout you should know URL of the components
you want to checkout.
Syntax:
[vinod@localhost]$ svn checkout/co URL PATH

Example
[vinod@localhost] svn co
https://192.168.101.147:8443/svn/VLSI_ASIC/branches/verilog/
IPIP_ASIC_JUL_2018/project_groups/
G2_I2C_MASTER_Slave
Svn commit (ci)
Whenever you do changes to the working copy, it will
not reflect in SVN server. To make the changes
permanent, you need to do SVN commit.
Syntax:
[vinod@localhost]$ svn add file1 file2

[vinod@localhost]$ svn ci -m “write your comment”


Note: svn commit command will work on already created
files/directory. If files or directories are not created already
then ,you need to perform ‘svn add file1 file2 ‘ followed by ‘svn
commit -m “write meaningful and elaborative comment so that
other user came to know about change”
svn list
SVN List: it is useful when you want to view the content of the
SVN repository, without downloading a working copy

[vinod@localhost]$ svn list

Example:
[vinod@localhost] svn list –verbose
https://192.168.101.147:8443/svn/VLSI_ASIC/branches/verilog/
IPIP_ASIC_JUL_2018/project_groups/
G2_I2C_MASTER_Slave

Ouput:
879 VisualSV Aug 16 12:05 ./

Note: revision is denoted using numeric character


And ‘879’ is revision number
svn add
When you want to add a new file (or directory) to the repository
you need to use SVN add command. The repository will have
newly added file, only when you do SVN commit. Now let us
add a new file called “thegeekstuff” to our repository.

[vinod@localhost]$ gvim newfile1.txt


//do your work on file and them perform below operation
[vinod@localhostvinod@localhost]$ svn add newfile1.txt
A newfile1.txt

Commit the add to file:


Svn commit -m “adding file named ‘newfile1.txt’ for purpose
description“
Adding newfile1.txt
Transmitting file data
Committed version 786
Svn difference
SVN diff displays the differences between your working copy
and the copy in the SVN repository. You can find the difference
between two revisions and two paths etc.,

Syntax:

[vinod@localhost]$ svn diff newfile1.txt

[vinod@localhost]$ svn -r rev1:rev2 diff newfile1.txt


status
Svn status command gives status of file in the working copy .It
displays whether the working copy is modified, or its been
added/deleted, or file is not under revision control, etc.

[vinod@localhost]$ svn status

Example:
https://192.168.101.147:8443/svn/VLSI_ASIC/branches/verilog/
IPIP_ASIC_JUL_2018/project_groups/
G2_I2C_MASTER_Slave/newfile
‘update’ command
svn update command brings changes from the repository into
your working copy. If no revision is specified, it brings your
working copy up-to-date with the HEAD revision. Otherwise, it
synchronizes the working copy to the revision given in the
argument.

[vinod@localhost]$ svn update –username darshan.prajapti


A docs/newfile1.txts
A script
A sim
A design
A tesbench
‘move’ command
It displays whether the working copy is modified, or its been
added/deleted, or file is not under revision control, etc.

[vinod@localhost]$ svn move newfile1.txt oldfile1.txt


A oldfile1.txt
D newfile1.txt

Now the file is renamed only in the working copy, not in the
repository. To make the changes permanent, you need to
commit the changes.
[vinod@localhostt]$ svn commit -m “file renamed from
newfile1.txt to oldfile1.txt for purpose description”
‘resolve’ command

[vinod@localhost]$ svn resolve


https://192.168.101.147:8443/svn/VLSI_ASIC/branches/verilog/
IPIP_ASIC_JUL_2018/project_groups/
G2_I2C_MASTER_Slave --username user.name

You might also like