Transcription

Git: Part 1Overview & Object ModelThese slides were largely cut-and-pasted rial/ , with some additions from othersources. I have deleted a lot from the citedtutorial, and recommend that you listen to theentire tutorial on line, if you can.

Who needs eeds‐git/

Topics What is Git?SCM concepts used in GitGit object modelRepresentation of Git objects as filesReferences

Git A collection of tools developed by Linuxkernel group for SCM– Now used by several other groups, andapparently growing in popularity Actually implements a replicated versionedfile system Can be used to implement a variety ofsoftware configuration managementmodels and workflows

Git Flavor A collection of many toolsEvolved from scriptsSuited to a C programmer’s mentalityEverything is exposed and accessibleVery flexible– You can do anything the model permits– Including shooting yourself in the foot Need to understand the underlying model

Git has a lot of commands Learn a core subset of them And one of the GUI tools (e.g., gitk) Then learn the rest as you need them

Groups of Git commands Setup and branch management– init, checkout, branch Modify– add, delete, rename, commit Get information– status, diff, log Create reference points– tag, branch

Source codecontains– Directories– Filesis the substance of a software /2008‐07‐09/intro‐to‐git.pdf

RepositoryContains– files– commitsrecords history of changes to /2008‐07‐09/intro‐to‐git.pdf

RepositoryContains– files– commits– ancestry /2008‐07‐09/intro‐to‐git.pdf

Ancestry relationshipsform a directed acyclic 08‐07‐09/intro‐to‐git.pdf

Ancestry graph featuresTags– identify versions of interest– including l/2008‐07‐09/intro‐to‐git.pdf

Ancestry graph featuresHEAD– is current checkout– usually points to a 07‐09/intro‐to‐git.pdf

Head may point to any commitIn this case it issaid to be 8‐07‐09/intro‐to‐git.pdf

Git componentsIndex– “staging area”– what is to 008‐07‐09/intro‐to‐git.pdf

HistoryA database, stored in directory 008‐07‐09/intro‐to‐git.pdf

Staging areaAlso stored in directory 008‐07‐09/intro‐to‐git.pdf

Files you editStored in the directory containing directory 008‐07‐09/intro‐to‐git.pdf

08‐07‐09/intro‐to‐git.pdf

ial/2008‐07‐09/intro‐to‐git.pdf

Checking torial/2008‐07‐09/intro‐to‐git.pdf

Local OperationsIndex(stagingarea)Repository(.git directory)Workingdirectorycheckout the projectadd (stage) filescommit

Object types BlobsTreesCommitsTags

Git Object e/objects‐example.png

As UML class el.png

Repository

.git/objects - - - - - ‘--23‘-- d4bd826aba9e29aaace9411cc175b784edc39976‘-- 49f82d40a98b1ba59057798e47aab2a99a11d3loosec4‘-- aaefaa8a48ad4ad379dc1002b78f1a3e4ceabce7‘-- 4be61128eef713459ca4e32398d689fe80864einfo‘-- packspack -- -- pack-b7b026b1a0b0f193db9dea0b0d7367d25d3a68cc.pack

Some other repository files .git/config.git/description – used by gitweb.git/info/exclude – files to ignore.

Repository object naming convention“content addressable” ‐07‐09/intro‐to‐git.pdf

Data values determine 7‐09/intro‐to‐git.pdf

Hash value is ‐07‐09/intro‐to‐git.pdf

File contains 7‐09/intro‐to‐git.pdf

07‐09/intro‐to‐git.pdf

07‐09/intro‐to‐git.pdf

07‐09/intro‐to‐git.pdf

07‐09/intro‐to‐git.pdf

07‐09/intro‐to‐git.pdf

07‐09/intro‐to‐git.pdf

07‐09/intro‐to‐git.pdf

07‐09/intro‐to‐git.pdf

Objects are 8‐07‐09/intro‐to‐git.pdf

References students.stanford.edu/ eekherocomic.com/2009/01/26/who-needsgit/