1 / 14

Intro to Version Control

Intro to Version Control. Have you ever …? Had an application crash and lose ALL of your work Made changes to a file for the worse and wished you could have recovered an earlier version Saved files with dates or descriptions in their names to help track versions (e.g. report_v2_27Nov2010.doc)

malina
Télécharger la présentation

Intro to Version Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to Version Control • Have you ever …? • Had an application crash and lose ALL of your work • Made changes to a file for the worse and wished you could have recovered an earlier version • Saved files with dates or descriptions in their names to help track versions (e.g. report_v2_27Nov2010.doc) • Overwritten a newer version of a file by accident • Wanted to selectively integrate file changes made by others • Kept different versions of a file but were not sure what the differences were because you did not keep a log

  2. Benefits of Source Control • Backup code outside of your working folder or even on a remote computer  disaster recovery • There are internet-based source control service providers • Commit changes to file(s)/folder(s) into the repository with some descriptive text • Revert file(s)/folder(s) back to some previous state • Review changes that have been made since last commit (Diff) • For text files – something you can open and edit in Notepad(e.g. code files not Word or Excel documents) • Multiple users can access same files over a network and have their own working copy

  3. Main concepts and workflow Repository Working copy Original folder Import / Add Checkout Edit files, add/rename files/folders, etc. Commit Edit files, add/rename files/folders, etc. Commit etc.

  4. Create a repository • Right-click on folder (I like Repo suffix) • Do NOT add folders or files to this folder • Interact with repository with TortoiseSVN

  5. Import / Add folder to Repository • Import • Create target folder in repository using TortoiseSVN Repo-browser • Import source folder into repository

  6. Import / Add folder to Repository • Add • Use Repo-Browser to create base target folder (optional) • Add Folder Can create many root folders in a repository (separate folder = unique URL)

  7. Create a Working Copy • Checkout from repository • If you are confident, delete original folder contents before checkout to that folder

  8. Add new file/folder to Working Copy Select, right-click, Add … Select, right-click, Commit

  9. Delete/Rename files/folders • NEVER use Explorer to delete/rename files/folders in a working copy. Use TortoiseSVN !! • Right-click file/folder and … • … and then Commit

  10. Version control in a team • Users have local working copy that can be synchronized/compared/updated to a central repository (Update) (Update) (Commit)

  11. Working copy details • A folder that has a _svn or .svn sub-folder contains a copy of sibling files & information about 1st level sub-folders at time of Checkout or last Update

  12. TortoiseSVN • A GUI for Subversion integrated into Explorer Right-click in any folder …

  13. Diff’ing and Blaming with TortoiseSVN

  14. Version control key concepts you must know • Repository(Create Repository Here in TortoiseSVN creates a SVN Repository in a folder) • A databased stored in standard named folders (e.g. conf, data). and files. Stores the data from user’s folders / files that are under version control. Accessed via client software (e.g. TortoiseSVN) • Working copy • Folder containing folders / files under version control. Each working copy folder/subfolder has a special folder (_svn or .svn) that contains a copy of sibling files & information about 1st level sub-folders at time of checkout or last update. • Import • Import folder and any folders/files it contains into repository. • Checkout • Checkout folder and any folders/files from a repository into a working copy folder (has _svn folder) • Export • Exports folder and any folders/files from a repository into a folder (not working copy, no _svn) • Commit • Commit changes in working copy folders/files to the repository • Update • Update a working copy with latest changes in the repository • Diff • Shows the differences between working copy and repository (any revision) • Revert • Reverts the content of the working copy to an earlier version (revision) in the repository • History / Log • Shows the “commit” messages for the selected working copy folder(s)/file(s) • Add • Add a new file/folder to the repository • Delete & Rename • Delete/Rename file using repository client (e.g. TortoiseSVN) NOT explorer. This will ensure folders/files are synchronized with the repository

More Related