SVN Code+Document repository
SVN Repository by LHC Higgs XS WG
Getting started with SVN and how to check out the repository
- Please do "svn update" before you start editing !!!
- Please make sure that LaTeX compiles normally before committing to SVN !!!
Principle is that:
- First you download (checkout) the latest files at the SVN server at CERN to your local machine.
- Edit file, create/move/copy/delete new file/directory, whatever you want at your local machine.
- Then reflect (commit) your changes to the SVN server at CERN.
How to modify the file
- Maybe it is a good idea to delete very old files at your local machine via rm -rf cernrep4 .
1) First "checkout" the files on SVN onto your local directory.
ex. at lxplus.cern.ch, at your local Linux/MAC/Windows (MAC knows svn)
svn co svn+ssh://svn.cern.ch/reps/lhchiggsxs/documents/Yellow_Report/cernrep4
(on lxplus)
or
svn co svn+ssh://username@svn.cern.ch/reps/lhchiggsxs/documents/Yellow_Report/cernrep4
(on local Linix/MAC/Windows, then enter the password at CERN)
* Beware username on svn.cern is account at cern and could be different from your local id.
* Password is requested twice.
This creates the directory "cernrep4" at your local machine.
2) Go to source file directory
cd cernrep4/trunk
* Beware this directory is copied into your local disk.
3) You can edit/modify/create files at the same directory at your local disk.
4) Make sure that LaTeX compilation is OK by typing "make" (Makefile)
make
It is sometimes good idea to clean up your local files.
$ make clean
rm -f *.aux *.log *.bbl *.blg *.brf *.cb *.ind *.idx *.ilg *.inx *.dvi *.toc *.out *~ ~* spellTmp
5) Make sure that someone else changed the same file during you are editing.
svn update
6) Commit your changes to SVN server at CERN
svn ci -m "enter your comments" filename
How to import files
Useful SVN Commands
- In SVN, it is always three steps,
- do something at your local disk,
- tell SVN that you added/modified something, "svn command options",
- change will be only effective only after you commit to SVN via "svn ci -m "your message for log" options".
- Please check useful SVN commands in various documents, or from SVN Book
1) Add new file or folder (
svn add )
2) Delete file or folder (
svn del/delete/rm/remove )
svn del filename
3) Rename/Move file (
svn mv/move/ren/rename )
svn mv filename new_filename
4) Copy files/directory to other place (
svn cp/copy filename/directory destination )
svn cp directory ../new_directory (example)
What to do when conflicts are found (commit fail) ?
- During you are editing the file, someone else might have modified the file and committed it to SVN.
- In such case, when you commit your update to SVN, an error message will be displayed.
-
1) Try "svn update" to reflect the modification by other parties to your local machine, and edit the file to resolve the conflicts.
- SVN will automatically check the modification and will try to merge them.
- When conflicts are found, Type df (display difference), p (mark up conflicts) etc., and modify the file (maybe manually).
$ svn update
Conflict discovered in 'ABC.tex'.
Select: (p) postpone, (df) diff-full, (e) edit,
(h) help for more options:
2) After resolving the conflicts, type "svn resolved" so that you can commit to SVN.
svn resolved <file name>
3) You can also try "svn revert ABC.tex" to delete all your changes to working copy, "svn status" to check the status of changes you added to the working copy.
--
ReiTanaka - 20-Feb-2010