Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009.

Similar presentations


Presentation on theme: "1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009."— Presentation transcript:

1 1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009

2 2 Git is a SCM (Source Control Management System) Management of changes to documents, programs, and other information stored as computer files. Its first usage have been for Linux and for Git itself. It is open source and free

3 3 Torvalds and “Git” Written by Linus Torvalds -- Mr. Linux What does the word “git” mean? –Nothing? –“A person who is deemed to be despicable or contemptible “ ? From http://www.google.ca/search?hl=en&client=firefox-a&rls=org.mozilla:en- US:official&hs=Ll1&defl=en&q=define:git&ei=wi7NSofxA4rflAevs- TgBQ&sa=X&oi=glossary_definition&ct=title

4 4 Git: A Fast Version Control System Git –Is distributed –Has no master copy –Has fast merges –Is controversial –Scales up –Convenient tools still being built –Safeguards against corruption

5 5 Bibliography Overview of Git (1 hour video). by Randal Schartz, 2007, Google talk, no diagrams http://www.youtube.com/watch?v=8dhZ9BXQgc4 http://www.youtube.com/watch?v=8dhZ9BXQgc4 Tv's cobweb: Git for Computer Scientists (nice diagrams) http://eagain.net/articles/git-for-computer-scientists/ A tutorial introduction to Git (key examples uses of commands) ohttp://www.kernel.org/pub/software/scm/git/docs/ v1.2.6/tutorial.htmlhttp://www.kernel.org/pub/software/scm/git/docs/ v1.2.6/tutorial.html

6 6 UW CS746 Seminar Course on Software Architecture Studying Git architecture (Fall 2009) Suggested/clarified various ideas given here

7 7 Fundamental Concepts of Source Control Management Source control management = SCM. Records information about an evolving software project). Key example: CVS. Project (set of files and directories, typically comprising the source files of a software system under development, but could be any other “content”) Version (one instance of a project) (called a commit in Git)

8 8 More Fundamental Concepts of Source Control Management Branch. A sequence of versions, each one evolved from the previous one To branch. Split development into two parallel branches. To merge. Combine two branches into single branch Repository. In this case, a specialized database to store an evolving project with its branches

9 9 Git’s Distributed Architecture: P2P System of distributed repositories R1, R2,... Mostly Git repositories, but can be CVS etc. Ovals are servers Boxes are individual repositories R1 R2 R3 R4 R5

10 10 Architecture of Git Individual Repository Object storage. Some times called simply a repository. Stores representation of the versions of project (in a directory called.git ) Git’s Index. Caches objects from work space that have changed (added to index), and that will be stored in the repository with the next commit Work space. User’s sandbox (ordinary files and directories) for active version

11 11 Architecture of Git Individual Repository Working tree (sand box) Index (cache) addcommit One Repository Object store pull, push More Repositories

12 12 Data Structure of Repository: ERD Defines Allowed DAGs commit tree blob version file tree of folders Each commit (version) is based on zero or more previous versions Each folder contains other folders and files (blobs) Generally, committed structure is immutable

13 13 Naming Nodes by Their Hashes The name (or key) of a node is the hash (SHA1) of its contents. A hash can be used as a “pointer” to locate its content Identical files have the same hash and are represented by a single blob

14 14 Layered Structure of Implementation of Repository GUI Porcelain (High Level Operations) Plumbing (Low Level Operations) Operations are separate executables (not API)

15 15 Key Git Operations 1 ) Init. Create an empty Git repository 2) Clone. Copy a repository into a new directory. After cloning, edit, create and remove files for new version 3) Add. Add file contents from work space to the index. (The files are edited locally) 4) Remove = rm. Remove files from work space and from the index 5) Commit. Store the changes (that are added) to the repository, using the index. Completes this version. 6) Branch. Create (or delete) a branch 7) Merge. Join two or more branches 8) Rebase. Combine/restructure a set of commits to simplify them 9) Checkout. Checkout files etc from a commit, and switch work space to that new branch 10) Fetch. Download objects and refs from another repository 11) Pull. Fetch from and merge with another repository or a local branch 12) Push. Update remote refs (in another repo) along with associated objects


Download ppt "1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009."

Similar presentations


Ads by Google