Version Control in Software Development

undefined
Version Control
 
1
Version control
 (or 
revision control
) is the term for
the management of source files, and all of the
intermediate stages as development proceeds.
A 
version control system
 is a repository of files.
Every change made to the source is tracked, along
with who made the change, etc.
Other items can be kept in a 
version control system
in addition to source files -- Project Charter, Product
Backlog, Test Plan, Inspection log, Testing log, ….
 
2
 
3
Version control 
allows us to:
Keep everything of importance in one place
Manage changes made by the team
Track changes in the code and other items
Avoid conflicting changes
 
4
Reversion:
 If you make a change, and discover it is
not viable, how can you revert to a code version that is
known to be good?
Change/Bug Tracking
: You know that your code has
changed; but do you know who did it, when, and why?
Sometimes this is where a bug was introduced?
Branches:
 How to introduce a completely new feature
or concept and not mess up the working code?
Merging branches:
 If I divided the code, how to
merge new code with good old code and not mess up
 
5
Commit:
 the action of writing or merging the changes made in the working
copy back to the repository
Trunk
: The unique line of development that is not a branch (sometimes called
the 
baseline
 or 
mainline
)
Head:
 The most recent commit
 
6
Main Trunk
Apple
Apple
Orange
Strawberry
Apple
Orange
Banana
Apple
Orange
Revision 1
Revision 2
Revision 3
Revision 4 (HEAD)
To add the file to the repository:
To check-in (commit) the file:
The -m flag is the message to use for this check-in.
Note: Subversion (svn) commands are described in
http://www.yolinux.com/TUTORIALS/Subversion.html
 
7
svn add list.txt
svn ci list.txt –m “Changed the list”
 
8
Main Trunk
Check Out
Check In (Commit)
Revert
To get the latest version:
To throw away changes:
To check out a particular version:
 
9
svn checkout list.txt
svn revert list.txt
svn checkout –r2 list.txt
A set of files under version control may be 
branched
 (or forked) at a
point in time so that, from that time forward, two (or more!) copies of a
file may develop in different ways independently of each other.
 
10
Apple
Grape
Revision 4
Apple
Grape
Kiwi
Revision 7
Branch
Main Trunk
Apple
Grape
Revision 5
Apple
Grape
Cherry
Revision 6
svn copy /path/to/trunk /path/to/branch
In SVN:
 
11
Apple
Grape
Revision 4
Apple
Grape
Kiwi
Revision 7
Branch
Main Trunk
Apple
Grape
Revision 5
Apple
Grape
Cherry
Revision 6
svn merge –r6:7 /path/to/branch
In SVN:
Apple
Grape
Kiwi
Cherry
Revision 8
+Cherry
+Kiwi
+Cherry
A 
conflict
 occurs when different parties make changes to the same
document, and the system is unable to reconcile the changes. A user
must resolve the conflict by combining or manually editing the changes.
 
12
                                      Main Trunk
Apple
Grape
Revision 4
Apple
Grape
Cherry
Revision 4* (Bob)
Apple
Kiwi
Revision 4* (Alice)
Apple
Grape
Cherry
Revision 5
Check In
Check In
Conflict
Each team must use some version control
system. You must use a repository which
requires authentication. This is so that no other
team can gain access to your repository.
In addition to turning in documents on
BlackBoard, teams will also commit their
documents and code to their repository
Give your Project Coordinator access to view
your repository
 
13
GitHub is a web-based hosting service
for software development projects that
use the Git revision control system
GitHub <https://github.com>
GitHub offers free accounts for open
source projects
 
14
GitHub Documentation
<https://help.github.com>
GitHub is the most popular open source code
repository site
We suggest you use GitHub to gain
experience with it
Employers, startups, and hackathons
increasingly use Github
 
15
Bitbucket is a web-based hosting service for projects
that use either the Git or Mercurial revision control
systems
Bitbucket <https://bitbucket.org>
Bitbucket Free Academic Accounts
<http://blog.bitbucket.org/2012/08/20/bitbucket-
academic>
Bitbucket Documentation
<https://confluence.atlassian.com/display/BITBUCKET/
Bitbucket+Documentation+Home>
 
16
Subversion (SVN) - http://subversion.apache.org
TortoiseSVN (Windows) - http://tortoisesvn.tigris.org
Concurrent Version Systems (CVS) -
http://savannah.nongnu.org/projects/cvs
Git - http://git-scm.com
GitHub (Mac & Windows) – http://www.github.com
TortoiseGit (Windows) -
http://code.google.com/p/tortoisegit
Mercurial - 
http://mercurial.selenic.com
RabbitVCS (Linux) - http://www.rabbitvcs.org
 
17
Slide Note
Embed
Share

Version control (or revision control) is essential for managing source files and tracking changes made by teams during development. It allows for reversion to stable code versions, change tracking, branch management, and merging. Learn about commit actions, trunk development lines, and using Subversion commands for effective repository management.

  • Software Development
  • Version Control
  • Source Files
  • Change Tracking
  • Branch Management

Uploaded on Oct 05, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Version Control 1

  2. Version control (or revision control) is the term for the management of source files, and all of the intermediate stages as development proceeds. A version control system is a repository of files. Every change made to the source is tracked, along with who made the change, etc. Other items can be kept in a version control system in addition to source files -- Project Charter, Product Backlog, Test Plan, Inspection log, Testing log, . 2

  3. 3

  4. Version control allows us to: Keep everything of importance in one place Manage changes made by the team Track changes in the code and other items Avoid conflicting changes 4

  5. Reversion: If you make a change, and discover it is not viable, how can you revert to a code version that is known to be good? Change/Bug Tracking: You know that your code has changed; but do you know who did it, when, and why? Sometimes this is where a bug was introduced? Branches: How to introduce a completely new feature or concept and not mess up the working code? Merging branches: If I divided the code, how to merge new code with good old code and not mess up 5

  6. Commit: the action of writing or merging the changes made in the working copy back to the repository Trunk: The unique line of development that is not a branch (sometimes called the baseline or mainline) Head: The most recent commit Main Trunk Apple Apple Orange Apple Orange Banana Apple Orange Strawberry Revision 1 Revision 2 Revision 3 Revision 4 (HEAD) 6

  7. To add the file to the repository: svn add list.txt To check-in (commit) the file: svn ci list.txt m Changed the list The -m flag is the message to use for this check-in. Note: Subversion (svn) commands are described in http://www.yolinux.com/TUTORIALS/Subversion.html 7

  8. Main Trunk Apple Orange Banana Check Out Apple Orange Strawberry Revision 3 Revision 4 Apple Orange Strawberry Working Copy Revert Check In (Commit) 8

  9. To get the latest version: svn checkout list.txt To throw away changes: svn revert list.txt To check out a particular version: svn checkout r2 list.txt 9

  10. A set of files under version control may be branched (or forked) at a point in time so that, from that time forward, two (or more!) copies of a file may develop in different ways independently of each other. Apple Grape Apple Grape Cherry Revision 5 Revision 6 Branch Main Trunk Apple Grape Apple Grape Kiwi In SVN: svn copy /path/to/trunk /path/to/branch Revision 4 Revision 7 10

  11. Apple Grape Apple Grape Cherry +Cherry Revision 5 Revision 6 Branch Main Trunk Apple Grape Apple Grape Kiwi Apple Grape Kiwi Cherry +Kiwi +Cherry Revision 4 Revision 7 Revision 8 In SVN: svn merge r6:7 /path/to/branch 11

  12. A conflict occurs when different parties make changes to the same document, and the system is unable to reconcile the changes. A user must resolve the conflict by combining or manually editing the changes. Apple Grape Cherry Check In Revision 4* (Bob) Apple Grape Apple Grape Cherry Main Trunk Revision 4 Revision 5 Apple Kiwi Check In Conflict Revision 4* (Alice) 12

  13. Each team must use some version control system. You must use a repository which requires authentication. This is so that no other team can gain access to your repository. In addition to turning in documents on BlackBoard, teams will also commit their documents and code to their repository Give your Project Coordinator access to view your repository 13

  14. GitHub is a web-based hosting service for software development projects that use the Git revision control system GitHub <https://github.com> GitHub offers free accounts for open source projects 14

  15. GitHub Documentation <https://help.github.com> GitHub is the most popular open source code repository site We suggest you use GitHub to gain experience with it Employers, startups, and hackathons increasingly use Github 15

  16. Bitbucket is a web-based hosting service for projects that use either the Git or Mercurial revision control systems Bitbucket <https://bitbucket.org> Bitbucket Free Academic Accounts <http://blog.bitbucket.org/2012/08/20/bitbucket- academic> Bitbucket Documentation <https://confluence.atlassian.com/display/BITBUCKET/ Bitbucket+Documentation+Home> 16

  17. Subversion (SVN) - http://subversion.apache.org TortoiseSVN (Windows) - http://tortoisesvn.tigris.org Concurrent Version Systems (CVS) - http://savannah.nongnu.org/projects/cvs Git - http://git-scm.com GitHub (Mac & Windows) http://www.github.com TortoiseGit (Windows) - http://code.google.com/p/tortoisegit Mercurial - http://mercurial.selenic.com RabbitVCS (Linux) - http://www.rabbitvcs.org 17

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#