20160324_svn
20160324_svn
Idea 1 : they start to use different names, write names of the files
with date, names, ….
→ no one knows which is the correct version, or which one was the
last working one, who make each modification and why
Sharing files can get messy ….
Idea 1 : they start to use different names, write names of the files
with date, names, ….
→ no one knows which is the correct version, or which one was the
last working one, who make each modification and why
What is a Version Control Systems ?
rev1
Check out
Local Changes
rev2
commit
How do Version Control Systems work ?
USER 1 USER 2
rev1
rev2
commit
commit
rev3
How do Version Control Systems work ?
USER 1 USER 2 USER 3
rev1
rev2
commit
commit commit
rev3 Rev4 → there
is a conflict –
it's need a
discussion
between users
Basic use of SVN
Example :
> cd modipsl/modeles/INCA
> svn info
Path: .
URL: http://forge.ipsl.jussieu.fr/inca/svn/tags/INCA5.1.2
Repository Root: http://forge.ipsl.jussieu.fr/inca/svn
Repository UUID: dc8988e9-b232-0410-ba9d-85c4b96cce30
Revision: 487
Node Kind: directory
Schedule: normal
Last Changed Author: acosce
Last Changed Rev: 480
Last Changed Date: 2016-01-07 11:03:01 +0100 (Thu, 07 Jan 2016)
svn stat / svn status : To know which files have been modified
compared to extracted version
> svn stat
? arch.fcm
? config > svn help stat
? arch.path 'A' Added
M src/INCA_SRC/mkdvel.F90 'C' Conflicted
M src/INCA_SRC/ub_inti.F90 'D' Deleted
M src/INCA_SRC/mksflx.F90 'M' Modified
M src/INCA_SRC/adjh2o.F90 '?' item is not under version control
'!' item is missing
* a newer revision exists on the server
Basic use of SVN
svn diff : Show difference compare to extracted version
Example :
> svn diff src/INCA_MOD/chem_mod.F90
Index: src/INCA_MOD/chem_mod.F90
==================================================================
=
--- src/INCA_MOD/chem_mod.F90 (revision 486)
+++ src/INCA_MOD/chem_mod.F90 (working copy)
@@ -98,7 +98,7 @@
REAL, SAVE, ALLOCATABLE :: nas(:,:,:) ! non-advected
species( mmr )
# else
REAL, SAVE :: nadv_mass(no_size)
- REAL, SAVE :: nas(1) ! place holder
+ REAL, SAVE :: nas(no_size) ! place holder
# endif
!$OMP THREADPRIVATE(nadv_mass)
!$OMP THREADPRIVATE(nas)
Lines starting with “+” are added in the local version (also called working
copy).
Lines starting with “-” are removed.
Basic use of SVN
svn update : Update working copy with the latest revision on the
server
Updates only with changes on the same branch (the directory and
it's sub-directories)
Local changes will be kept. Conflicts can occur if the same file is
modified locally and on the server
Changes are done only in the local working directory
Example :
If you extracted a tag or a branch, changes done on the trunk will
not be added in your directory.
If there is a conflict on a file, type p for postpone. svn will then save
your modifications in a separate file. The file without modifications
is also saved in your directory.
Commit with SVN
svn add newfile.f90 Put files and/or directories under version control.
They will be added in next commit
svn rm file.f90 The file will be removed locally and the file is
scheduled to be removed from the svn repository in
next commit.
svn commit / svn ci Commit all changes in the directory to the server
The revision number is increased.