Date post: | 01-Apr-2015 |
Category: |
Documents |
Upload: | bilal-mountford |
View: | 215 times |
Download: | 1 times |
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
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
Main concepts and workflow
RepositoryWorking copyOriginal folder
Import / Add
Checkout
Edit files, add/renamefiles/folders, etc.
Commit
Edit files, add/renamefiles/folders, etc.
Commit
etc.
Create a repository
Right-click on folder (I like Repo suffix)
Do NOT add folders or files to this folderInteract with repository with TortoiseSVN
Import / Add folder to Repository
ImportCreate target folder in repository using TortoiseSVN Repo-browserImport source folder into repository
Import / Add folder to Repository
AddUse Repo-Browser to create base target folder (optional)Add Folder
Can create many root folders in a repository (separate folder = unique URL)
Create a Working Copy
Checkout from repositoryIf you are confident, delete original folder contents before checkout to that folder
Add new file/folder to Working Copy
Select, right-click, Add … Select, right-click, Commit
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
Version control in a team
Users have local working copy that can be synchronized/compared/updated to a central repository
(Update)
(Commit) (Update)
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
TortoiseSVNA GUI for Subversion integrated into Explorer
Right-click in anyfolder …
Diff’ing and Blaming with TortoiseSVN
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 copyFolder 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.
ImportImport folder and any folders/files it contains into repository.
CheckoutCheckout folder and any folders/files from a repository into a working copy folder (has _svn folder)
ExportExports folder and any folders/files from a repository into a folder (not working copy, no _svn)
CommitCommit changes in working copy folders/files to the repository
UpdateUpdate a working copy with latest changes in the repository
DiffShows the differences between working copy and repository (any revision)
RevertReverts the content of the working copy to an earlier version (revision) in the repository
History / LogShows the “commit” messages for the selected working copy folder(s)/file(s)
AddAdd a new file/folder to the repository
Delete & RenameDelete/Rename file using repository client (e.g. TortoiseSVN) NOT explorer. This will ensure folders/files are synchronized with the repository