360 likes | 632 Views
Visual SourceSafe. For more information, see: http://www.microsoft.com/ssafe. Agenda. Introductions Visual SourceSafe Basics Advanced Visual SourceSafe Questions. Agenda. Introductions Visual SourceSafe Basics Advanced Visual SourceSafe Questions. Basic Purposes of Visual SourceSafe.
E N D
Visual SourceSafe For more information, see: http://www.microsoft.com/ssafe
Agenda • Introductions • Visual SourceSafe Basics • Advanced Visual SourceSafe • Questions
Agenda • Introductions • Visual SourceSafe Basics • Advanced Visual SourceSafe • Questions
Basic Purposes of Visual SourceSafe • Version control systems in general... • Support team development, by coordinating multiple users through a checkout/checkin protocol • Track versions of files • SourceSafe’s competitive advantage... • Track versions of entire projects • Track modular code: one file that is reused, or shared, by multiple projects
Visual SourceSafe Basics • Key SourceSafe Concepts • Setup: A Two-Step Process • Visual SourceSafe, Editing Tools, and the Working Folder • SourceSafe Commands • Organizing Your Files • The SourceSafe Explorer, Integration into Editing Environment • Version Numbers and Labels
Key SourceSafe Concepts • All your files are stored in a centralized database on the server • Any kind of files can be stored in SourceSafe: code, DLLs, graphics, documents, help files, icons, … • A project is a collection of files in the SourceSafe database, analogous to a folder in Windows
Setup: A Two-Step Process • The SourceSafe Administrator runs SETUP.EXE from the CD and chooses “Server Setup” to create the SourceSafe database. • Each user then goes to the server where the SourceSafe database was installed (not from the CD), and runs NETSETUP.EXE to copy the executables to his local hard drive.
Visual SourceSafe, Editing Tools, and the Working Folder • You store and track your files in SourceSafe projects • You edit and compile your files in the “working folder” which your editing tools see • Your tool does not have to know about SourceSafe, and vice-versa! SourceSafe projects (eg $/A/B) Working Folder (eg C:\WORKING)
The Four Key Commands • Get: Give me a local copy of a file or project in my working folder, read-only, to view or compile • Check Out: Give me a local copy of a file or project, writable, to edit. (*May or may not be exclusive!) • Check In: Copy my edited file back into SourceSafe, available to other users. (Stores old versions with reverse deltas.) • Undo Check Out: Cancel my check out, voiding all the changes I made
Other Important Commands • Create Project: Create a new project • Add Files: Add files to a project • Delete: Delete a file or project • Difference: Show me what changed in this file or project • Share: Copy files from other projects into the current project • History: Show me all the versions of this file or project
Organizing Your Files • Your SourceSafe project structure should mirror your local folder structure (or directory tree) • For instance, if your files are organized into one folder with three subfolders, create one SourceSafe project with three subprojects • Later, you may modify this a bit due to Sharing
The Working Folder • Your working folder is where you keep files locally. Get, Checkout, Check In, Difference, and other commands rely on it. • You set it through the “Set Working Folder” dialog. • The working folder is stored per user, per project, and per machine. • Settings automatically propagate down the project tree
Tips for Using the SourceSafe Explorer • Hold the “Shift” key down while selecting any command, and you will get a “pre-dialog” before the command executes (allowing you to select a date range for History, a format for Diff, etc) • Click on a project and choose a command, and the command will act on the whole project (eg Get a project, view project History, view project Difference)
SourceSafe Integration into Editing Environments • “Integration” means you can execute SourceSafe commands directly inside your editing environment. • Some less commonly used commands still require the SourceSafe Explorer. • This kind of integration is available through Visual C++, Visual Basic, Access, FrontPage, Visual J++, Visual FoxPro, and others. • Macros are available for free on our Web page to integrate with Office 97 and Word/Excel 95.
Example: Visual SourceSafe Integration into Visual C++ This picture shows a cool SourceSafe dialog coming up in the middle of Visual C++.
Version Numbers and Labels • Version numbers count up automatically: 1, 2, 3, etc. • User-defined version numbers are in the form of labels such as “2.00b” or “Beta 2” on a file or a project • When you reach a project milestone or release, don’t create a new project, and don’t label the files. Label the project. • Retrieving an old version of a project recovers the files that were in the project at that time
Agenda • Introductions • Visual SourceSafe Basics • Advanced Visual SourceSafe • Questions
Advanced Visual SourceSafe • Web Features • Sharing • Pinning • Branching/Merging • Customization • The SourceSafe Command Line • Other Advanced Features
SourceSafe Web Features If you are using SourceSafe to manage your Web site… • “Deploy” copies your files to the live Web server (via folder path or FTP) • “Check Hyperlinks” checks the validity of internal links (to your own files) • “Create Site Map” creates an HTML site map you can post on your page
Sharing • Sharing is how you track reusable files • Technically, sharing means that one file is in multiple projects at the same time • All updates are automatically propagated, since there is only one file • There is no “master project”: all sharing projects are peers • Use the “Links” tab (Options dialog) to track Shared files
“$/A and $/B share Fu.cpp” … or… “Fu.cpp is in $/A and $/B” In this picture, the file has 5 versions. If either project checks in the file, both projects will be on version 6 5 4 3 2 1 Sharing $/A $/B Fu.cpp
Pinning • A pin says “Whatever other projects do, I am frozen at version x” • Pinning controls the pace at which updates are received • Pinning is controlled through the History dialog • When a file is pinned, you cannot check a file out: it is frozen
$/A shares the most recent version of Fu.cpp $/B is pinned to version 4 of Fu.cpp 5 4 3 2 1 Pinning $/A $/B Fu.cpp
Branching/Merging • Branching a shared file creates a new file in the SourceSafe database • Updates do not propagate now, and both files can be modified separately • Don’t branch when you just need a pin! • You can see the branch history of the file by using the “Paths” tab in Properties • Branching a project branches all the files • Later, you can merge the changes back
After the file branches, there are two independent FU.C files, one in each project Versions 1-3 are the same: Versions 4-5 are different Branching $/A $/B Fu.cpp Fu.cpp 5 5 4 4 3 3 2 2 1 1
Share/Pin/Branch Scenario • While working on version 4.0 of your project, you need to patch of version 3.0. • So you share version 3.0 of the project. This creates a “patch” project where all files are shared with the main line, but pinned to their versions from 3.0. • You can’t check out these pinned files. So to modify a file on the patch, branch it. • Later, you may merge these bug fixes back into the main line
Customization This picture shows the first tab in the SourceSafe Options dialog. Play with the dialog to see the many ways you can customize SourceSafe!
The Visual SourceSafe Command Line • All SourceSafe functionality fully available from the command line (except some of the Web-specific features) • Great for macros, batch files, and integration: also sometimes faster to use than the GUI • Commands look like “SS Get FU.CPP” (means, “Get this file from the current project into my current folder”)
Other advanced features • “Keyword expansion” puts version control information directly into your source file • “Shadow folders” create a public share that echoes a SourceSafe project • “Project security” sets user rights on a project-by-project basis • “OLE Automation” lets you drive SourceSafe from VC++ or VB
Questions? For more information, see: http://www.microsoft.com/ssafe