Version ControlWhy version control?Why version control? (part 2)Version control for teamsTeams (part 2)diff toolsjDiffSlide 8Version control systemssccsrcsrcs commandsWho cares about UNIX?CVS commandsCVS home pageThe EndJan 14, 2019Version Control2Why version control?Scenario 1:Your program is workingYou change “just one thing”Your program breaksYou change it backYour program is still broken--why?Has this ever happened to you?3Why version control? (part 2)Your program worked well enough yesterdayYou made a lot of improvements last night......but you haven't gotten them to work yetYou need to turn in your program nowHas this ever happened to you?4Version control for teamsScenario:You change one part of a program--it worksYour co-worker changes another part--it worksYou put them together--it doesn’t workSome change in one part must have broken something in the other partWhat were all the changes?5Teams (part 2)Scenario:You make a number of improvements to a classYour co-worker makes a number of different improvements to the same classHow can you merge these changes?6dif toolsThere are a number of tools that help you spot changes (differences) between two filesTools include dif, rcsdif, jDif, etc.Of course, they won't help unless you kept a copy of the older versionDifferencing tools are useful for finding a small number of differences in a few files7jDifjDif is a plugin for the jEdit editorAdvantages:Everything is color codedUses synchronized scrollingIt's inside an editor--you can make changes directlyDisadvantages:Not stand-alone, but must be used within jDifJust a diff tool, not a complete solution8jDif9Version control systemsA version control system (often called a source code control system) does these things:Keeps multiple (older and newer) versions of everything (not just source code)Requests comments regarding every changeAllows “check in” and “check out” of files so you know which files someone else is working onDisplays differences between versions10sccssccs is Source Code Control System (UNIX)sccs keeps multiple versions of a complete directoryStorage requirements are small, because sccs:keeps the original documentskeeps the changes needed to go from one version to the nextgenerates any version when you ask for it11rcsrcs is Revision Control System (also UNIX)rcs is like sccs, and does the same things, butsccs keeps the originals, and applies changes to get to newer versionsrcs keeps the current versions, and applies changes to get back to older versions(Opinion) You usually want to work with the newer versions, so rcs is usually the better choice12rcs commandsCreate a directory for your rcs filesco -l fil e -- check out a file and lock itLocking means you can check the file back inci file -- check in a revision (put file under rcs control)rcs -l fil e -- lock a file you already checked out(Needed when you checked it out and forgot the -l )rcsdif files -- report differences between filesmerge files -- merges two files into original fileNot magic--you have to check the results13Who cares about UNIX?CVS (Concurrent Versions System) is the most popular version control system on WindowsCVS is built on top of rcsCVS is built into JBuilder and Eclipse“There are two ways to run CVS on Windows 95/NT. The first is as a client, talking to a CVS server on a Unix box. This is the recommended setup and is commonly used.” -- http://www.cvshome.org/dev/codewindow.html14CVS commandscvs checkout filecvs commit filecvs dif fileThese are CVS commands under UNIXPopular GUIs on Windows:tkCVSjCVSWinCVS15CVS home pagehttp://www.cvshome.org16The
View Full Document