Let’s start with some questions:

Slides:



Advertisements
Similar presentations
Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
Advertisements

Git Branching What is a branch?. Review: Distributed - Snapshots Files are stored by SHA-1 hash rather than filename Stored in git database in compressed.
Introduction to git Alan Orth Nairobi, Kenya September, 2010 version control for serious hackers ;)
Source Code Revision Control with Subversion Christophe Dupré May 13, 2005 Update KEJ May 10, 2006 Scientific Computation Research Center Rensselaer Polytechnic.
Patterns & practices Symposium 2013 Introducing Git version control into your team Mark
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Git: Part 1 Overview & Object Model These slides were largely cut-and-pasted from tutorial/, with some additions.
Fundamentals of Git By Zachary Ling 29 th, Aug,
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
Git – versioning and managing your software L. Grewe.
1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009.
Version Control Systems academy.zariba.com 1. Lecture Content 1.What is Software Configuration Management? 2.Version Control Systems (VCS) 3.Basic Git.
…using Git/Tortoise Git
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Git Super Basics. What is Git? Version Control System (VCS) Successor to SVN in the Drupal eco-system A tool.
Paul McGrath.  Speedy Input  Speedy Visualisation  Speedy Workflow.
Version Control Systems. Version Control Manage changes to software code – Preserve history – Facilitate multiple users / versions.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
GIT: What, how and why ? Part 1: Basics. What do I know about git? Started using it for experiments on April 2009 Moved all voms development on git on.
INTRODUCTION TO GIT. Install Egit for eclipse Open eclipse->Help->Install New Software Search for one of the following -
Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.
Git 101 Or, How to sanely manage your Koha customizations.
Jun-Ru Chang Introduction GIT Jun-Ru Chang
Git for bzr users October Aurélien Gâteau An attempt at making you comfortable when you have to work with a git repository.
Git Girish Git VCS that I have used ClearCase, cvs, svn Happy p4 user.
Backing up a machine with git
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
CS5220 Advanced Topics in Web Programming Version Control with Git
Information Systems and Network Engineering Laboratory II
I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson
Primož Gabrijelčič Git for Programmers Primož Gabrijelčič
Version Control Systems
11 Version control (part 2)
Git Practice walkthrough.
Discussion 11 Final Project / Git.
Sign in on the attendance sheet!
Version Control with Subversion (SVN)
GIT – tips & tricks Partnership.
Learning GIT CodicePlastico.com.
CS5220 Advanced Topics in Web Programming Version Control with Git
Version Control System using Git
Git branches and remotes
An introduction to version control systems with Git
SU Development Forum Introduction to Git - Save your projects!
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
An introduction to version control systems with Git
An introduction to version control systems with Git
Git-Github Tools Prepared for COP4331. Git-Github Tools Prepared for COP4331.
Git Best Practices Jay Patel Git Best Practices.
Git CS Fall 2018.
Version Control System - Git
Version control with Git
Version Control Philip Ritchey slides generously gifted by Jeff Huang.
Git started with git: 2018 edition
Version Control with Git
GitHub 101 Using Github and Git for Source Control
Git Fundamentals.
Git Introduction.
Git GitHub.
1. GitHub.
Introduction to The Git Version Control System
Advanced Git for Beginners
Presentation transcript:

Let’s start with some questions: What is a repository? What is a commit?

To the terminal!

What is a repository? Repository . ├── .git │ ├── branches │ ├── COMMIT_EDITMSG │ ├── config │ ├── description │ ├── FETCH_HEAD │ ├── HEAD │ ├── hooks │ ├── index │ ├── info │ ├── logs │ ├── objects │ ├── ORIG_HEAD │ ├── packed-refs │ └── refs ├── some files ├── more files └── even more files Repository

What is a commit? $ git cat-file -p 2dfc9fe tree fcfde60a5d645769d536f9b7c0726560ed225a14 parent e4fdd0e4e49842d50f75e4d80f555fa783c0709f author Alan Du <alanhdu@gmail.com> 1496355755 +0100 committer Alan Du <alanhdu@gmail.com> 1496355755 +0100 Store fractional seconds as a u32 instead of a f64 Drops precision down to the nanoseconds

What are branches? Refs are “nicknames” for commits Branches are “auto-updating” refs (via HEAD)

What does this mean practically? git checkout COMMIT git checkout BRANCH git checkout REF

What does this mean practically? Is it: git checkout origin/master git pull origin/master Or is it: git checkout origin master git pull origin master

What does this mean practically? Is it: git checkout origin/master git pull origin/master Or is it: git checkout origin master git pull origin master

What does this mean practically? git bisect start git bisect bad COMMIT git bisect good COMMIT Binary search to find which commit introduced the bug

What does this mean practically? Merge, baby, merge? (git merge) Or rebase all the things? (git rebase)

So clearly we’re done right?

Git is a “snapshot”-based system Commits store the current tree There’s no first-class notion of diff or patch!!! Git’s ability to deal with diffs is ad-hoc and fundamentally flawed

What’s wrong with snapshots? git cherry-pick Let’s say you’re the cpython project and have: master 3.6 3.5 3.4 2.7

What’s wrong with snapshots? git cherry-pick Cherry-picking changes the identity of the commit! So if you cherry-pick two related commits in the wrong order..

It gets worse A / \ B B New feature!

It gets worse A / \ B B New feature! | | A A Revert the change!

It gets worse A / \ B B New feature! |\ /| A X A Revert the change! |/ \| B B Merge each other’s work

It gets worse A / \ B B New feature! |\ /| A X A Revert the change! |/ \| B B Merge each other’s work \ / B WTF?

≠ It gets worse Git’s merge algorithm is fundamentally flawed In general: B1 – B2 / \ \ A \ \ \ \ \ A1 – A2 – A3 B1 – B2 / \ A \ \ \ A1 ––––– A3 ≠

The Fundamental Problem is that diffs in git are second-class citizens So… why don’t we just make diffs first-class citizens? Can only add or delete lines (no editing!) Each patch records the “ancestry” of each line (or deletion)

Patches Compose

Commutative Diagram

The Merge Commutative Diagram

Not a merge

Not a merge

But that isn’t unique! We want the “smallest” merge (In the language of category theory, we want the pushout).

One Technical Detail The pushout isn’t always a file!

One Technical Detail The pushout isn’t always a file! In category theory terms, need the free co-completion

How does this help us? How to revert shoes?

Quick Summary What are: Git repositories? Git commits? Git branches? What’s wrong with snapshot-based systems? Baby patch theory (inspired by Darcs and Pijul)

References https://git-scm.com/book/en/v2 https://jneem.github.io/merging/ https://tahoe-lafs.org/~zooko/badmerge/concrete- good-semantics.html http://r6.ca/blog/20110416T204742Z.html https://codewords.recurse.com/issues/two/git-from- the-inside-out

Questions?