Using with LeMANS and MONACO Timothy R. Deschenes and Alexandre Martin Department of Aerospace Engineering, University of Michigan September 15, 2008
Outline 1
Why Use Version Control Provides one method for an entire team to use; everybody operates under the same ground rules Make changes available to others in the group; improves collaboration Changes are oderly, saves development time Ability to track changes promotes accountability and makes it easier to solve problems. List of exact changes made can be generated quickly and easily. Ability to automatically back up code Easy to roll back to an earlier version institution-log
ITCS NGPD group has dedicated space on ITCS Can access using ssh protocol Automatic daily backups held for a week Automatic weekly backups held for six months
Initial Setup
Initial Checkout (svn checkout)
Initial Checkout (svn checkout)
Branch Creation (svn cp)
Branch Created
Updating Working Copy (svn update)
Commit Changes (svn commit)
Commited (svn commit)
Merging from another branch (svn merge)
Merged Trunk to Branch
Commiting Changes from Merge (svn commit)
Commiting Changes from Merge (svn commit)
Changes Committed to Repository (svn commit)
Checkout Checkout a working copy svn checkout svn+ssh://uniquename@login.itd.umich.edu\ /afs/umich.edu/group/acadaff/ngpd/svn-repos/svnlemans/lemans \ SVNlemans cd SVNlemans
Getting Information from Server Update a working copy from server svn update Updates to most recent version in repository svn update -r 1234 Updates to revision #1234 svn update -r 1000 foo.c Updates just foo.c to revision 1000
Getting Info (cont d) Updating Working Copy from Another Branch/Trunk svn merge You specify where to get the information Used to update one branches changes on another Also way to reintegrate your branch into the trunk Make sure you specify correct directory Similar syntax to update except you must specify server
Getting Info (cont d) Update/merge output U foo.c A foo.c D foo.c R foo.c File foo.c was (U)pdated (received changes from server) File foo.c was (A)dded to your working copy File foo.c was (D)eleted from your working copy File foo.c was (R)eplaced in your working copy (ie: that file was previously deleted, then added back to the repository)
Getting info (cont d) Update/merge output G foo.c C foo.c File foo.c was mer(g)ed from your changed copy and the repository s copy File foo.c was in (C)onflict with the repository. You have edited the same lines as someone else. A person must examine the files and decide which changes to implement (or blend the two together).
Conflict Resolution svn puts temporary files of each different file that must be examined by the person Pick which changes to keep and put in working copy file Use svn resolve foo.c and svn will delete temp files and keep whatever you put in foo.c Can also use svn revert to toss out all changes
Making Changes Edit files Use favorite text editor, package manager, etc Add Files to Working Copy svn add foo.c Can also add directories (automatically recursive for directories) Delete files svn rm foo.c (no need to delete file first) Rename files svn mv foo.c foo.old.c Copy Files or Directories svn cp foo.c foo.old.c (automatically recursive for directories) institution-log
Examining Changes output svn status Can see more information with -v Can see even more information with -u (but requires network access) institution-log
Examining Changes svn diff Used to show differences in files svn diff -r 3 foo.c Show differences between current foo.c and revision 3 version svn revert Undo changes (revert back to last update) Commit changes svn commit -m Log Message Updates the repository to match local working copy
Examining Past Changes Log Message Make sure log messages describe the changes made svn log Easy for other users to examine past evolution shows past log messages that have been processed in your branch -r 5:19 limit range of log messages printed Can also see the log for a particular file Only shows log for revisions changed that particular file
Further Reference () home http://subversion.tigris.org/ Book http://svnbook.red-bean.com/ MONACO repository location on AFS /afs/umich.edu/group/acadaff/ngpd/svn-repos/svnmonaco LeMANS repository location on AFS /afs/umich.edu/group/acadaff/ngpd/svn-repos/svnlemans ITCS login address login.itd.umich.edu institution-log