+ All Categories
Home > Documents > Intro to Version Control Have you ever …? Had an application crash and lose ALL of your work Made...

Intro to Version Control Have you ever …? Had an application crash and lose ALL of your work Made...

Date post: 01-Apr-2015
Category:
Upload: bilal-mountford
View: 215 times
Download: 1 times
Share this document with a friend
Popular Tags:
14
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
Transcript
Page 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.

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

Page 2: 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.

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

Page 3: 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.

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.

Page 4: 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.

Create a repository

Right-click on folder (I like Repo suffix)

Do NOT add folders or files to this folderInteract with repository with TortoiseSVN

Page 5: 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.

Import / Add folder to Repository

ImportCreate target folder in repository using TortoiseSVN Repo-browserImport source folder into repository

Page 6: 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.

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)

Page 7: 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.

Create a Working Copy

Checkout from repositoryIf you are confident, delete original folder contents before checkout to that folder

Page 8: 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.

Add new file/folder to Working Copy

Select, right-click, Add … Select, right-click, Commit

Page 9: 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.

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

Page 10: 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.

Version control in a team

Users have local working copy that can be synchronized/compared/updated to a central repository

(Update)

(Commit) (Update)

Page 11: 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.

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

Page 12: 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.

TortoiseSVNA GUI for Subversion integrated into Explorer

Right-click in anyfolder …

Page 13: 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.

Diff’ing and Blaming with TortoiseSVN

Page 14: 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.

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


Recommended