SlideShare a Scribd company logo
Content
 Version control
 Advantages & disadvantages of GIT
 GIT basics
 Subversion
 TortoiseSVN
 How to use SVN
 Rules on using SVN
2
Version Control
 Version control (or revision control, or source control) is all
about managing multiple versions of documents,
programs, web sites, etc.
Some well-known version control systems are CVS, Subversion,
Mercurial, and Git.
Distributed systems like Mercurial and Git are newer and are
gradually replacing centralized systems like
CVS and Subversion.
3
Local Version Control
 Local version-control method of choice is to copy files
into another directory(perhaps a time-stamped directory, if
they’re clever).
This approach is very common because it is so simple, but
it is also incredibly error prone.
 Ex :-
• RCS
4
Local Version Control5
Centralized Version Control
 Traditional version control system.
• Server with database
• Clients have a working version
 Challenges
• Multi-developer conflicts
• Client/server communication
 Ex :-
• CVS
• Subversion
• Visual source safe
6
Centralized Version Control7
Distributed Version Control
 Authoritative server by convention only.
 Every working checkout is a repository.
 Get version control even when detached.
 Backups are trivial.
 Ex :-
• Mercurial
• BitKeeper
• Darcs
• Bazaar
8
Distributed Version Control9
Advantages of GIT
 Resilience
• No one repository has more data than any other
 Speed
• Very fast operations compared to other VCS (I’m
looking at you CVS and Subversion)
 Space
• Compression can be done across repository not just per
file
• Minimizes local size as well as push/pull data transfers
 Simplicity
• Object model is very simple
 Large user base with robust tools
10
Disadvantages of GIT
 Definite learning curve, especially for those used to
centralized systems.
• Can sometimes seem overwhelming to learn
 Conceptual difference
 Huge amount of commends
11
GIT Basics
 Storing data as changes to a base version
of each file.
12
 Storing data as snapshots of the project over
time.
13
 Working directory,staging area, and Git directory.
14
Introduce yourself to GIT
 Enter these lines (with appropriate changes):
• git config --global user.name "John Smith"
• git config --global user.email
jsmith@seas.upenn.edu
 You only need to do this once.
 If you want to use a different name/email address for a
particular project, you can change it for just that project.
• cd to the project directory.
• Use the above commands, but leave out the --global
15
Create and fill a repository
 cd to the project directory you want to use.
 Type in git init
• This creates the repository (a directory named .git).
• You seldom (if ever) need to look inside this directory.
 Type in git add
• The period at the end is part of this command!
• Period means “this directory”.
• This adds all your current files to the repository.
 Type in git commit –m "Initial commit“
• You can use a different commit message, if you like.
16
Clone a repository from elsewhere
 git clone URL
 git clone URL mypath
• These make an exact copy of the repository at the
given URL.
 git clone git://github.com/rest_of_path/file.git
• Github is the most popular (free) public repository.
 All repositories are equal,
• But you can treat some particular repository (such as
one on Github) as the “master” directory.
 Typically, each team member works in his/her own
repository, and “merges” with other repositories as
appropriate.
17
Making commits
 If you create new files and/or folders, they are not tracked by
Git unless you ask it to do so.
• git add newFile1 newFolder1 newFolder2 newFile2
 Committing makes a “snapshot” of everything being tracked
into your repository.
• A message telling what you have done is required
• git commit –m “Uncrevulated the conundrum bar”
• git commit
 This version opens an editor for you the enter the
message.
 To finish, save and quit the editor.
 Format of the commit message.
• One line containing the complete summary.
• If more than one line, the second line must be blank.
18
Choose an editor
When you “commit,” git will require you to type in a commit
message.
For longer commit messages, you will use an editor.
The default editor is probably vim .
To change the default editor:
• git config --global core.editor /path/to/editor
You may also want to turn on colors:
• git config --global color.ui auto
19
Typical workflow
 git pull remote_repository
• Get changes from a remote repository and merge them
into your own repository.
 git status
• See what Git thinks is going on.
• Use this frequently!
 Work on your files (remember to add any new ones).
 git commit –m “What I did”
 git push
20
Multiple versions
Initial commit
Second commit
Third commit
Bob gets a copy
Fourth commit
Merge
Bob’s commit
21
 Developed in 2000 and 2001 (by CollabNet,
Inc.)
to replace CVS and its shortcomings
• Subversion is free
• Subversion is open-source
• Subversion operates across a network
• Subversion handles any types of files,
documents, or directories
• Subversion requires administrative
support
What is subversion22
 On its own, Subversion is command-line driven
• UNIX:
• MS-DOS:
 Numerous GUIs have been built on top of SVN
• TortoiseSVN
• VisualSVN
• XCode (Mac OS X)
Using Subversion
http://tortoisesvn.net/
23
TortoiseSVN is
• Open-source (free)
• Integrated directly
into Windows Explorer
• Usable with any development environment
TortoiseSVN
http://tortoisesvn.net/
24
Open source application – download it from
• http://tortoisesvn.net/downloads
After the installation a new
option appears in the menu when
 you right click on a folder.
25
 Checkout:
• Receives a copy of an entire project from the
SVN server.
• (Source files, project & make files, resource files,
etc.).
 Update:
• Receives copies of individual files or folders on
the server and merges them with your current
copy (locally).
How to use SVN26
 Commit:
• Sends an updated file (your local copy) to the
SVN server where.
• It is incorporated into the original project
database;
a new version number is assigned not the entire
project.
 Add:
• Notifies SVN of a new file or folder that needs to
be added to the existing project (only if SVN is
aware of a file, can you commit the file).
How to use SVN Cont.27
Right click in the folder you want to check out
into
Select SVN Checkout…
How to checkout28
 URL of repository:
http://svn.cs.wayne.edu/svn/csc4111w11/
29
Enter the user name and password:
• Your accessID (xx1234) and the same
password you use for Pipeline/Blackboard
30
• Select the project you want to download:
31
 If you have a set of files checked out and
would like to update them to the most
recent version of files in the repository, use the
update command.
 If there are newer files in the repository, they will
overwrite any files you have locally, if you
haven’t changed them.
 TortoiseSVN can merge some files on its own,
but may tell you there are conflicts with others.
 If a file has a conflict use diff.
Update32
How to update
 Right click on the file, folder or project you want to
update and choose SVN Update
33
 Once you have added, deleted, or changed
files or directories, you can then commit those
changes to the repository.
 Before committing you should always update.
 The safest way to commit, is to diff your project
before you commit.
 Always check your project out after a commit
and make sure it compiles.
Commit34
 All commits need to be commented.
 If you forget to comment, make a trivial change
to a file and commit adding in your comment
that it applies to the previous commit.
Commit Comments35
 Include:
• Your Name
• The type of commit (Change, Bug Fix, …)
• What the commit does (Adds ToolTip dialog …)
• Any other important details
 Don’t include:
• The names of the files (The log will have them)
• The date or time
36
How to commit
 Right click on the file, folder or project you
want to update and choose SVN
Commit…
37
 Right click on the file you want to diff.
 Select Diff, this will compare your file to the most
recent (Head) version on the repository. In a
new window.
How to Diff38
If just a word changed, it will be in red on one
side yellow on the other
You can use the green arrows to navigate
through the differences.
Diff - How to solve conflicts39
If lines were added/deleted one side will have
gray the other yellow.
The Edit menu has options to help you combine
the files.
40
 Before you commit make sure you add the file
into the repository
 After you add - commit
Adding new files41
 If your commit breaks the baseline.
 Update your local copy
 Check out the last good version
 Commit this version
If you make a bad commit42
 Carefully test your code before committing
 Before committing, perform an update on the
whole source code directory, and then retest
 Always commit only the individual files you
modified, not the entire directory
 When adding new files to the existing source
code, always perform SVN Add and then SVN
Commit
 When you have conflicts, contact the
teammates which modified that file and try to
solve the conflicts together to avoid damages.
Rules on using SVN43
 Do not share your login and password – you are
responsible for all changes made with your ID
 Do not check out projects of other groups !!!
 If you check in modifications to the project of
other group you might be responsible for that
 If you do not understand something, please ask
GTA before doing that
 If you do not like a client that we’re suggesting
you to use, you’re free to use any other
available SVN client (but please notify me and
write a couple of lines explaining why)
44
 www.powershow.com/view4/456743
OGRkM/Version_Control_using_Subversion_SVN_po
werpoint_ppt_presentation.
 https://www.google.com/search?
q=souce+control&ie=utf-8&oe=utf-
8#q=source+control+svn+ppt.
 http://www.powershow.com/view1/7d30b-
ZDc1Z/Version_Control_using_Subversion_SVN_pow
erpoint_ppt_presentation.
 “Version control with git”, Jon Leoliger, O'Reilly
2009.
 “Pro Git”,2nd
Edition, Scott Chacon, Ben Straub.
References45
Source control

More Related Content

What's hot

What is the merge window?
What is the merge window?What is the merge window?
What is the merge window?
Macpaul Lin
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
Bimal Jain
 
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Revelation Technologies
 
Synchronization
SynchronizationSynchronization
Synchronization
misra121
 
Kernel Recipes 2015: The stable Linux Kernel Tree - 10 years of insanity
Kernel Recipes 2015: The stable Linux Kernel Tree - 10 years of insanityKernel Recipes 2015: The stable Linux Kernel Tree - 10 years of insanity
Kernel Recipes 2015: The stable Linux Kernel Tree - 10 years of insanity
Anne Nicolas
 
Git vs cvs ece2011
Git vs cvs ece2011Git vs cvs ece2011
Git vs cvs ece2011
da152
 
Dita Release Management
Dita Release ManagementDita Release Management
Dita Release Management
jlborie
 

What's hot (7)

What is the merge window?
What is the merge window?What is the merge window?
What is the merge window?
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
 
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Kernel Recipes 2015: The stable Linux Kernel Tree - 10 years of insanity
Kernel Recipes 2015: The stable Linux Kernel Tree - 10 years of insanityKernel Recipes 2015: The stable Linux Kernel Tree - 10 years of insanity
Kernel Recipes 2015: The stable Linux Kernel Tree - 10 years of insanity
 
Git vs cvs ece2011
Git vs cvs ece2011Git vs cvs ece2011
Git vs cvs ece2011
 
Dita Release Management
Dita Release ManagementDita Release Management
Dita Release Management
 

Viewers also liked

Scaling Source Control for the Next Generation of Game Development
Scaling Source Control for the Next Generation of Game DevelopmentScaling Source Control for the Next Generation of Game Development
Scaling Source Control for the Next Generation of Game DevelopmentToby Roberts
 
Mercurial: Modern Source Control Management
Mercurial: Modern Source Control ManagementMercurial: Modern Source Control Management
Mercurial: Modern Source Control Management
John Paulett
 
Understanding Distributed Source Control
Understanding Distributed Source ControlUnderstanding Distributed Source Control
Understanding Distributed Source ControlLorna Mitchell
 
Adding Source Control to Your Life
Adding Source Control to Your LifeAdding Source Control to Your Life
Adding Source Control to Your LifeMark Kelnar
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
Lorna Mitchell
 
Source Control 101
Source Control 101Source Control 101
Source Control 101
Robert MacLean
 
Version Control System
Version Control SystemVersion Control System
Version Control System
TechAhead
 

Viewers also liked (7)

Scaling Source Control for the Next Generation of Game Development
Scaling Source Control for the Next Generation of Game DevelopmentScaling Source Control for the Next Generation of Game Development
Scaling Source Control for the Next Generation of Game Development
 
Mercurial: Modern Source Control Management
Mercurial: Modern Source Control ManagementMercurial: Modern Source Control Management
Mercurial: Modern Source Control Management
 
Understanding Distributed Source Control
Understanding Distributed Source ControlUnderstanding Distributed Source Control
Understanding Distributed Source Control
 
Adding Source Control to Your Life
Adding Source Control to Your LifeAdding Source Control to Your Life
Adding Source Control to Your Life
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
Source Control 101
Source Control 101Source Control 101
Source Control 101
 
Version Control System
Version Control SystemVersion Control System
Version Control System
 

Similar to Source control

02-version control(DevOps Series)
02-version control(DevOps Series)02-version control(DevOps Series)
02-version control(DevOps Series)
Mohammed Shaban
 
Source control
Source controlSource control
Source control
Sachithra Gayan
 
GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
Mithilesh Singh
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
PouriaQashqai1
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
MohanRaviRohitth
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Sameera Wijesekara
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
Naveen Pandey
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
Eshaan35
 
Git
GitGit
Version control git day01
Version control   git day01Version control   git day01
Version control git day01
Gourav Varma
 
Version control git day01
Version control   git day01Version control   git day01
Version control git day01
Gourav Varma
 
Subversion
SubversionSubversion
Subversionthebdot1
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
Vikram SV
 
GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
Haitham Raik
 
Git
GitGit
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
Soumen Debgupta
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
AbhijitNarayan2
 
Subversion
SubversionSubversion
Subversion
Vaibhav Sakhalkar
 

Similar to Source control (20)

02-version control(DevOps Series)
02-version control(DevOps Series)02-version control(DevOps Series)
02-version control(DevOps Series)
 
Source control
Source controlSource control
Source control
 
GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
 
Git
GitGit
Git
 
Version control git day01
Version control   git day01Version control   git day01
Version control git day01
 
Version control git day01
Version control   git day01Version control   git day01
Version control git day01
 
Subversion
SubversionSubversion
Subversion
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
Git
GitGit
Git
 
git.ppt
git.pptgit.ppt
git.ppt
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
 
Subversion
SubversionSubversion
Subversion
 
git.ppt.pdf
git.ppt.pdfgit.ppt.pdf
git.ppt.pdf
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

Source control

  • 1.
  • 2. Content  Version control  Advantages & disadvantages of GIT  GIT basics  Subversion  TortoiseSVN  How to use SVN  Rules on using SVN 2
  • 3. Version Control  Version control (or revision control, or source control) is all about managing multiple versions of documents, programs, web sites, etc. Some well-known version control systems are CVS, Subversion, Mercurial, and Git. Distributed systems like Mercurial and Git are newer and are gradually replacing centralized systems like CVS and Subversion. 3
  • 4. Local Version Control  Local version-control method of choice is to copy files into another directory(perhaps a time-stamped directory, if they’re clever). This approach is very common because it is so simple, but it is also incredibly error prone.  Ex :- • RCS 4
  • 6. Centralized Version Control  Traditional version control system. • Server with database • Clients have a working version  Challenges • Multi-developer conflicts • Client/server communication  Ex :- • CVS • Subversion • Visual source safe 6
  • 8. Distributed Version Control  Authoritative server by convention only.  Every working checkout is a repository.  Get version control even when detached.  Backups are trivial.  Ex :- • Mercurial • BitKeeper • Darcs • Bazaar 8
  • 10. Advantages of GIT  Resilience • No one repository has more data than any other  Speed • Very fast operations compared to other VCS (I’m looking at you CVS and Subversion)  Space • Compression can be done across repository not just per file • Minimizes local size as well as push/pull data transfers  Simplicity • Object model is very simple  Large user base with robust tools 10
  • 11. Disadvantages of GIT  Definite learning curve, especially for those used to centralized systems. • Can sometimes seem overwhelming to learn  Conceptual difference  Huge amount of commends 11
  • 12. GIT Basics  Storing data as changes to a base version of each file. 12
  • 13.  Storing data as snapshots of the project over time. 13
  • 14.  Working directory,staging area, and Git directory. 14
  • 15. Introduce yourself to GIT  Enter these lines (with appropriate changes): • git config --global user.name "John Smith" • git config --global user.email jsmith@seas.upenn.edu  You only need to do this once.  If you want to use a different name/email address for a particular project, you can change it for just that project. • cd to the project directory. • Use the above commands, but leave out the --global 15
  • 16. Create and fill a repository  cd to the project directory you want to use.  Type in git init • This creates the repository (a directory named .git). • You seldom (if ever) need to look inside this directory.  Type in git add • The period at the end is part of this command! • Period means “this directory”. • This adds all your current files to the repository.  Type in git commit –m "Initial commit“ • You can use a different commit message, if you like. 16
  • 17. Clone a repository from elsewhere  git clone URL  git clone URL mypath • These make an exact copy of the repository at the given URL.  git clone git://github.com/rest_of_path/file.git • Github is the most popular (free) public repository.  All repositories are equal, • But you can treat some particular repository (such as one on Github) as the “master” directory.  Typically, each team member works in his/her own repository, and “merges” with other repositories as appropriate. 17
  • 18. Making commits  If you create new files and/or folders, they are not tracked by Git unless you ask it to do so. • git add newFile1 newFolder1 newFolder2 newFile2  Committing makes a “snapshot” of everything being tracked into your repository. • A message telling what you have done is required • git commit –m “Uncrevulated the conundrum bar” • git commit  This version opens an editor for you the enter the message.  To finish, save and quit the editor.  Format of the commit message. • One line containing the complete summary. • If more than one line, the second line must be blank. 18
  • 19. Choose an editor When you “commit,” git will require you to type in a commit message. For longer commit messages, you will use an editor. The default editor is probably vim . To change the default editor: • git config --global core.editor /path/to/editor You may also want to turn on colors: • git config --global color.ui auto 19
  • 20. Typical workflow  git pull remote_repository • Get changes from a remote repository and merge them into your own repository.  git status • See what Git thinks is going on. • Use this frequently!  Work on your files (remember to add any new ones).  git commit –m “What I did”  git push 20
  • 21. Multiple versions Initial commit Second commit Third commit Bob gets a copy Fourth commit Merge Bob’s commit 21
  • 22.  Developed in 2000 and 2001 (by CollabNet, Inc.) to replace CVS and its shortcomings • Subversion is free • Subversion is open-source • Subversion operates across a network • Subversion handles any types of files, documents, or directories • Subversion requires administrative support What is subversion22
  • 23.  On its own, Subversion is command-line driven • UNIX: • MS-DOS:  Numerous GUIs have been built on top of SVN • TortoiseSVN • VisualSVN • XCode (Mac OS X) Using Subversion http://tortoisesvn.net/ 23
  • 24. TortoiseSVN is • Open-source (free) • Integrated directly into Windows Explorer • Usable with any development environment TortoiseSVN http://tortoisesvn.net/ 24
  • 25. Open source application – download it from • http://tortoisesvn.net/downloads After the installation a new option appears in the menu when  you right click on a folder. 25
  • 26.  Checkout: • Receives a copy of an entire project from the SVN server. • (Source files, project & make files, resource files, etc.).  Update: • Receives copies of individual files or folders on the server and merges them with your current copy (locally). How to use SVN26
  • 27.  Commit: • Sends an updated file (your local copy) to the SVN server where. • It is incorporated into the original project database; a new version number is assigned not the entire project.  Add: • Notifies SVN of a new file or folder that needs to be added to the existing project (only if SVN is aware of a file, can you commit the file). How to use SVN Cont.27
  • 28. Right click in the folder you want to check out into Select SVN Checkout… How to checkout28
  • 29.  URL of repository: http://svn.cs.wayne.edu/svn/csc4111w11/ 29
  • 30. Enter the user name and password: • Your accessID (xx1234) and the same password you use for Pipeline/Blackboard 30
  • 31. • Select the project you want to download: 31
  • 32.  If you have a set of files checked out and would like to update them to the most recent version of files in the repository, use the update command.  If there are newer files in the repository, they will overwrite any files you have locally, if you haven’t changed them.  TortoiseSVN can merge some files on its own, but may tell you there are conflicts with others.  If a file has a conflict use diff. Update32
  • 33. How to update  Right click on the file, folder or project you want to update and choose SVN Update 33
  • 34.  Once you have added, deleted, or changed files or directories, you can then commit those changes to the repository.  Before committing you should always update.  The safest way to commit, is to diff your project before you commit.  Always check your project out after a commit and make sure it compiles. Commit34
  • 35.  All commits need to be commented.  If you forget to comment, make a trivial change to a file and commit adding in your comment that it applies to the previous commit. Commit Comments35
  • 36.  Include: • Your Name • The type of commit (Change, Bug Fix, …) • What the commit does (Adds ToolTip dialog …) • Any other important details  Don’t include: • The names of the files (The log will have them) • The date or time 36
  • 37. How to commit  Right click on the file, folder or project you want to update and choose SVN Commit… 37
  • 38.  Right click on the file you want to diff.  Select Diff, this will compare your file to the most recent (Head) version on the repository. In a new window. How to Diff38
  • 39. If just a word changed, it will be in red on one side yellow on the other You can use the green arrows to navigate through the differences. Diff - How to solve conflicts39
  • 40. If lines were added/deleted one side will have gray the other yellow. The Edit menu has options to help you combine the files. 40
  • 41.  Before you commit make sure you add the file into the repository  After you add - commit Adding new files41
  • 42.  If your commit breaks the baseline.  Update your local copy  Check out the last good version  Commit this version If you make a bad commit42
  • 43.  Carefully test your code before committing  Before committing, perform an update on the whole source code directory, and then retest  Always commit only the individual files you modified, not the entire directory  When adding new files to the existing source code, always perform SVN Add and then SVN Commit  When you have conflicts, contact the teammates which modified that file and try to solve the conflicts together to avoid damages. Rules on using SVN43
  • 44.  Do not share your login and password – you are responsible for all changes made with your ID  Do not check out projects of other groups !!!  If you check in modifications to the project of other group you might be responsible for that  If you do not understand something, please ask GTA before doing that  If you do not like a client that we’re suggesting you to use, you’re free to use any other available SVN client (but please notify me and write a couple of lines explaining why) 44
  • 45.  www.powershow.com/view4/456743 OGRkM/Version_Control_using_Subversion_SVN_po werpoint_ppt_presentation.  https://www.google.com/search? q=souce+control&ie=utf-8&oe=utf- 8#q=source+control+svn+ppt.  http://www.powershow.com/view1/7d30b- ZDc1Z/Version_Control_using_Subversion_SVN_pow erpoint_ppt_presentation.  “Version control with git”, Jon Leoliger, O'Reilly 2009.  “Pro Git”,2nd Edition, Scott Chacon, Ben Straub. References45

Editor's Notes

  1. What is “version control”, and why should you care? Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.
  2. It iseasy to forget which directory you’re in and accidentally write to the wrong file or copy over files you don’t mean to. To deal with this issue, programmers long ago developed local VCSs that had a simple database that kept all the changes to files under revision control.
  3. A distributed version control system
  4. The major difference between Git and any other VCS (Subversion and friends included) is the way Git thinks about its data. Conceptually, most other systems store information as a list of file-based changes. These systems (CVS, Subversion, Perforce, Bazaar, and so on) think of the information they keep as a set of files and the changes made to each file over time.
  5. Git doesn’t think of or store its data this way. Instead, Git thinks of its data more like a set of snapshots of a miniature filesystem. Every time you commit, or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot. To be efficient, if files have not changed, Git doesn’t store the file again, just a link to the previous identical file it has already stored. Git thinks about its data more like a stream of snapshots.
  6. 1. You modify files in your working directory. 2. You stage the files, adding snapshots of them to your staging area. 3. You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.
  7. When you said git init in your project directory, or when you cloned an existing project, you created a repository The repository is a subdirectory named .git containing various files The dot indicates a “hidden” directory You do not work directly with the contents of that directory; various git commands do that for you You do need a basic understanding of what is in the repository
  8. Your top-level working directory contains everything about your project The working directory probably contains many subdirectories—source code, binaries, documentation, data files, etc. One of these subdirectories, named .git, is your repository At any time, you can take a “snapshot” of everything (or selected things) in your project directory, and put it in your repository
  9. A commit is when you tell git that a change (or addition) you have made is ready to be included in the project