Tortoise SVN A Subversion Client Copyright © 2015-2017 - Curt Hill Introduction • There are several Tortoise Windows version control clients • This presentation deals with the Subversion one – There is also a Mercurial and GIT one • Both of these are shell extensions – A plugin for Windows Explorer – AKA File Explorer • Most actions come from a right click and menu choice on a directory Copyright © 2015-2017 - Curt Hill Getting • The TortoiseSVN is free • Obtain at Source Forge among others • I downloaded an MSI file • Double click and its installed • Moreover, the server is standard with most LINUX installs so setting it up is very routine – What we will use for version control Copyright © 2015-2017 - Curt Hill Usage • Once installed it is a shell extension – An add-in to Windows explorer • There will also be a start menu entry to give access to some other features • The first task is to create a repository • For a local directory, this is done by right clicking a directory that will contain the new repository Copyright © 2015-2017 - Curt Hill Creating Copyright © 2015-2017 - Curt Hill This Happens Next Copyright © 2015-2017 - Curt Hill Resulting Directory Copyright © 2015-2017 - Curt Hill Filling the Repository • What do we want in the repository? • Two options – Import an existing subversion repository – Populate it with a new project Copyright © 2015-2017 - Curt Hill Import • The import process is to make a source directory part of the repository • This is the initial check in • Recall that there are certain files that should not be checked – Anything that can be generated • Subversion has a set of files that it will not check in but this may not be right – Found in preferences Copyright © 2015-2017 - Curt Hill Preferences Copyright © 2015-2017 - Curt Hill Importing a Project • Clean the directory structure – Remove anything that is pointless to commit • Right click on the directory to import • Enter the URL of the repository • Consider the following screens Copyright © 2015-2017 - Curt Hill Adding crdp directory Copyright © 2015-2017 - Curt Hill Next Copyright © 2015-2017 - Curt Hill Results Copyright © 2015-2017 - Curt Hill Now What? • The repository is now tracking things • However, there is nothing to track until some changes are made • Changes are handled by the process: – Check out code – Modify/test – Commit (or check in) Copyright © 2015-2017 - Curt Hill Process • Right click on directory you want things stored • Choose SVN Checkout • Fill in the dialog box items • As the following screens show, the directory is d:\temp and repository is one created earlier – Normally the repository is online instead of what is shown here Copyright © 2015-2017 - Curt Hill Check Out Copyright © 2015-2017 - Curt Hill Next Copyright © 2015-2017 - Curt Hill Finished Copyright © 2015-2017 - Curt Hill Dialog Box • The output directory is called the sandbox – This is where we will work on the code before check in • Since fully recursive was checked, the entire directory tree is extracted • There is some discrepancies in sizes and files between the original, the repository and the new Copyright © 2015-2017 - Curt Hill Files Directory Files Directories Size Original 269 4 43.2 Repository 36 10 11.4M Sandbox 151 75.2M 458 • Subversion is still holding onto the new directory • Keeping track of what will become of the files in it Copyright © 2015-2017 - Curt Hill Development • • • • • • Normal development now ensues Edit files Compile Test Repeat until you are happy Then put them back in – This is a commit Copyright © 2015-2017 - Curt Hill Changes have occurred Copyright © 2015-2017 - Curt Hill Starting Commit Copyright © 2015-2017 - Curt Hill Next Copyright © 2015-2017 - Curt Hill Commit Finished Copyright © 2015-2017 - Curt Hill File Status • Every file in the sandbox has one of four possible statuses: • Unchanged and current • Repo and local version match • Changed and current • An update awaiting a commit • Unchanged and out of date • Repository version of this has been updated • Changed and out of date • Both local and repository have been independently updated Copyright © 2015-2017 - Curt Hill Public Repositories • Those repositories that primarily use SVN can get an extraction this easily • Source Forge uses SVN more often than many others – Also uses Git • If on its code page a SVN URL is displayed then this directory tree may be downloaded • See next two pages Copyright © 2015-2017 - Curt Hill SVN svn://svn.code.sf.net/p/winmerge/code/trunk Copyright © 2015-2017 - Curt Hill Not SVN • git://git.code.sf.net/p/orwelldevcpp/code Copyright © 2015-2017 - Curt Hill Commentary • What you see in each of those pictures is the command line • The SVN command line looks like: svn checkout svn://svn.code.sf.net/p/winmerge/co de/trunk winmerge-code • The Git command line look like: git clone git://git.code.sf.net/p/orwelldevcpp/c ode orwelldevcpp-code • Trim this down to just the repository for the client Copyright © 2015-2017 - Curt Hill Disclaimer • This PowerPoint was created using a local repository • That is generally not the way it should be • The local copies, that is the sandbox, should be local • The repository should be on a server to be shared by many easily Copyright © 2015-2017 - Curt Hill Repositories • We will have repositories established on Euler • The exact name may vary by year and class – The name will be given in class as part of a demo Copyright © 2015-2017 - Curt Hill Process • Create an empty directory – Preferably near your other development directories • Check out the project into it • Examine, edit, modify, make and test – Until it works properly • Now check them in • Recall that you only check in things that are functional and do not cause problems to others Copyright © 2015-2017 - Curt Hill Check Out 1 Copyright © 2015-2017 - Curt Hill Check Out Dialog Copyright © 2015-2017 - Curt Hill Check Out Done Copyright © 2015-2017 - Curt Hill New Directory Copyright © 2015-2017 - Curt Hill Notes • The first time you will have to enter the address – After that it should be part of the drop down list • Next we are able to examine and modify what is there Copyright © 2015-2017 - Curt Hill Notes • Always put in the comment that tells who committed and what was done • It will only check in what is newer than what it has • If two teams are working on two different functions they will not interfere with each other • You should all have something checked in today Copyright © 2015-2017 - Curt Hill Finally • • • • • That is the cycle Check out Change Commit You do not need to check out again – Instead several commits may be done – An update will download what someone else has done • Lets now go have a look at a project Copyright © 2015-2017 - Curt Hill
© Copyright 2026 Paperzz