Slide 1

Slide 1 text

Software Engineering in Practice Version Control Systems

Slide 2

Slide 2 text

A typical scenario

Slide 3

Slide 3 text

Version control systems – Why? • Clutter free workspace (no numbered files) • Avoids duplication • Backup and restore • Synchronization • Undo • Track changes (with messages) • Track ownership • Merging and branching • Collaboration

Slide 4

Slide 4 text

VCS – History (1) Gen. Networking Operations Concurrency Examples 1 None One file at at time Locks SCCS, RCS 2 Centralized Multi-file Merge before commit Subversion, TFS, CVS 3 Distributed Change- sets/ snapshot Commit before merge Git, Bazaar, Mercurial http://ericsink.com/vcbe/html/history_of_version_control.html

Slide 5

Slide 5 text

VCS – History (2) http://www.iiis.org/cds2011/cd2011imc/iceme_2011/paperspdf/fb394vz.pdf SCCS by Marc J. Rochkind at BellLabs 1972 1980 RCS by Walter F. Tichy at Purdue Univ. 1985 CVS by Dick Grune at Vrije University 1992 ClearCase by Atria (later IBM) 1994 Visual SourceSafe by Microsoft 2000 Subversion by Karl Fogel 2005 Git by open-source community TFS by Microsoft

Slide 6

Slide 6 text

Let’s understand Git

Slide 7

Slide 7 text

Git basics (1) • Snapshots (and not change-sets) CVS, Subversion, and others Git

Slide 8

Slide 8 text

Git basics (2) • Local operations • Majority of operations are local - commit, log, branch... • Integrity • Impossible to change contents without Git knowing about it. • 40 char SHA-1 hash

Slide 9

Slide 9 text

Git basics (3) • Stages • Committed • Staged • Modified http://rogerdudler.github.io/git-guide/ https://git-scm.com/book/en/v2/Getting-Started-Git-Basics

Slide 10

Slide 10 text

Git Terminology

Slide 11

Slide 11 text

Terminology Repository The database storing the project files.

Slide 12

Slide 12 text

Terminology Commit (or check-in) The act of saving a working copy (a workfile or set of workfiles) to your repository.

Slide 13

Slide 13 text

Terminology Head (or tip) The latest version in a branch.

Slide 14

Slide 14 text

Terminology Branch A branch is a parallel version of a repository. http://rogerdudler.github.io/git-guide/

Slide 15

Slide 15 text

Terminology Clone A clone is a copy of a repository that lives on your computer instead of on a website's server.

Slide 16

Slide 16 text

Terminology Diff A diff is the difference in changes between two commits, or saved changes.

Slide 17

Slide 17 text

Terminology Fork A fork is a personal copy of another user's repository that lives on your account.

Slide 18

Slide 18 text

Terminology Merge Merging takes the changes from one branch (in the same repository or from a fork), and applies them into another.

Slide 19

Slide 19 text

Terminology Pull Pull refers to when you are fetching in changes and merging them.

Slide 20

Slide 20 text

Terminology Pull Request Pull requests are proposed changes to a repository submitted by a user and accepted or rejected by a repository's collaborators.

Slide 21

Slide 21 text

Terminology Push Pushing refers to sending your committed changes to a remote repository such as GitHub.com.

Slide 22

Slide 22 text

Let’s get our hands dirty

Slide 23

Slide 23 text

Installation https://git-scm.com/downloads

Slide 24

Slide 24 text

Commands Create a repository git init

Slide 25

Slide 25 text

Commands Clone a repository git clone

Slide 26

Slide 26 text

Commands Add a file to repository git add

Slide 27

Slide 27 text

Commands Commit git commit –m “description”

Slide 28

Slide 28 text

Commands Pull changes git pull

Slide 29

Slide 29 text

Commands Push changes git push

Slide 30

Slide 30 text

Commands Merge changes git merge

Slide 31

Slide 31 text

Commands See log git log

Slide 32

Slide 32 text

Commands See git repository status git status

Slide 33

Slide 33 text

Let’s get our hands dirty … actually

Slide 34

Slide 34 text

Now what? … Practice https://try.github.io/levels/1/challenges/1

Slide 35

Slide 35 text

Assignment Taksidiotis – Athens travel guide by the Greeks Tasks • Clone the repo – [email protected]:tushartushar/taksidiotis.git • Add an interesting place (such as museum, bar, or restaurant), activity (walking tour, or food/wine-tasting tour), or anything interesting for a tourist to the guide.md file • Contribute to at least 3 categories • The important thing is – you, as a Greek, are recommending it • You may change/modify text added by others • Try to arrange the entries in categories (such as ‘Tour’, ‘Food’, ‘History’, and ‘Islands’) • Commit your changes • Push to the GitHub repo • Deadline – 5 PM, Feb 28, 2018

Slide 36

Slide 36 text

Courtesy: spikedmath.com Thank you