Git - A brief overview

Similar documents
Git. (Why not CVS?... because Git.) Karel Zak Florian Festi Bart Trojanowski December 20, 2007

Basics of Git GitHub

A Practical Introduction to Version Control Systems

AIS Grid School 2015

Having Fun with Social Coding. Sean Handley. February 25, 2010

Fundamentals of Git 1

Git. Ľubomír Prda. IT4Innovations.

February 2 nd Jean Parpaillon

git the SCM system Jan-Simon Möller training.linuxfoundation.org

Git. all meaningful operations can be expressed in terms of the rebase command. -Linus Torvalds, 2015

Agenda. Several projects are using GIT Developer(s) Junio Hamano, Linus Torvalds. Qt Stable release (January 31, 2011)

Introduction to GIT. Jordi Blasco 14 Oct 2011

Source Code Management wih git

INET

Git for Version Control

Topics covered. Introduction to Git Git workflows Git key concepts Hands on session Branching models. Git 2

Version control with Git.

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

What is git? Distributed Version Control System (VCS); Created by Linus Torvalds, to help with Linux development;

CS 390 Software Engineering Lecture 5 More Git

CESSDA Expert Seminar 13 & 14 September 2016 Prague, Czech Republic

CSE 391 Lecture 9. Version control with Git

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

Outline The three W s Overview of gits structure Using git Final stuff. Git. A fast distributed revision control system

Lab Objective. Lab Assignment. Downloads and Installation

Public-Service Announcement

How to version control like a pro: a roadmap to your reproducible & collaborative research

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

How to be a git. Dominic Mitchell

Git. A fast distributed revision control system. Nils Moschüring PhD Student (LMU)

Version Control with GIT

Laboratorio di Programmazione. Prof. Marco Bertini

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

Submitting your Work using GIT

Version Control with Git

Revision Control. An Introduction Using Git 1/15

Distributed Version Control (with Git)

Tutorial: Getting Started with Git. Introduction to version control Benefits of using Git Basic commands Workflow

Version control. with git and GitHub. Karl Broman. Biostatistics & Medical Informatics, UW Madison

Θερινό Σχολείο, Ιουλίου git. Αχιλλέας Πιπινέλης. Μονάδα Αριστείας ΕΛ/ΛΑΚ ΤΕΙ Αθήνας

Basic git. Interactive.

Overview. 1. Install git and create a Github account 2. What is git? 3. How does git work? 4. What is GitHub? 5. Quick example using git and GitHub

About SJTUG. SJTU *nix User Group SJTU Joyful Techie User Group

Version Control: Gitting Started

Public-Service Announcement

Decentralized Version Control Systems

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

Git Introduction CS 400. February 11, 2018

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

Best Practices. Joaquim Rocha IT-DSS-TD

Introduction to GIT. The distributed SCM

Contribute To Linux Mainline

GIT. CS 490MT/5555, Spring 2017, Yongjie Zheng

Git. A Distributed Version Control System. Carlos García Campos

Push up your code next generation version control with (E)Git

Algorithm Engineering

Version Control Systems (VCS)

Introduction to Git For Groups

Git for Newbies. ComMouse Dongyue Studio

Software Development I

Version Control for Fun and Profit

I m an egotistical bastard, and I name all my projects after myself. First Linux, now git. Linus Torvalds, creator of Linux and Git

Git & Github Fundamental by Rajesh Kumar.

Git Workflows. Sylvain Bouveret, Grégory Mounié, Matthieu Moy

Git. Christoph Matthies Software Engineering II WS 2018/19. Enterprise Platform and Integration Concepts group

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

Using Git For Development. Shantanu Pavgi, UAB IT Research Computing

GIT Princípy tvorby softvéru, FMFI UK Jana Kostičová,

Git Internals. Source code control and beyond by Scott Chacon

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Version Control System - Git. zswu

Git Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : October, More documents are freely available at PythonDSP

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Github/Git Primer. Tyler Hague

Index. Alias syntax, 31 Author and commit attributes, 334

VSO. Configuration Management

E, F. deleteall command, 352 directory structure, 350 export_data method, 353 inline_data method, 353 print_export method, 351 target directory, 351

Version Control. Version Control

Git for Subversion users

Revision Control. How can 4. Slides #4 CMPT 276 Dr. B. Fraser. Local Topology Simplified. Git Basics. Revision Control:

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Gerrit

GIT for companies Mark Struberg, INSO TU Vienna

Working with GIT. Florido Paganelli Lund University MNXB Florido Paganelli MNXB Working with git 1/47

Introduction to the UNIX command line

TDDC88 Lab 4 Software Configuration Management

Git better. Collaborative project management using Git and GitHub. Matteo Sostero March 13, Sant Anna School of Advanced Studies

Using git to download and update BOUT++

AMath 483/583 Lecture 2

Introduction to Git and Github Repositories

2/9/2013 LAB OUTLINE INTRODUCTION TO VCS WHY VERSION CONTROL SYSTEM(VCS)? II SENG 371 SOFTWARE EVOLUTION VERSION CONTROL SYSTEMS

Git Basi, workflow e concetti avanzati (pt2)

Git for (not-so) dummies

Software Project (Lecture 4): Git & Github

CS 390 Software Engineering Lecture 3 Configuration Management

Code and data management with Git. Department of Human Genetics Center for Human and Clinical Genetics

AMath 483/583 Lecture 2. Notes: Notes: Homework #1. Class Virtual Machine. Notes: Outline:

Section 1: Tools. Contents CS162. January 19, Make More details about Make Git Commands to know... 3

Version Control with GIT: an introduction

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

Transcription:

breno.leitao@gmail.com Linux Technology Center May 16, 2008

Agenda Introduction Concepts Commands (Tutorial) Front Ends

History Started in 2005 to replace BitKeeper. Designed to support the kernel development. Used widely: Wine, Beryl, OLPC, Fedora, Ruby on Rails, VLC, yum, etc Multi-platform: Mac OS X, Windows, Linux and Unix GPL v2 Originally written by Linus Torvalds Git is currently maintained by Junio C Hamano

The name "I m an egotistical bastard, and I name all my projects after myself. First Linux, now git 1 " Linus Torvald 1 git is British slang for silly, stupid, or worthless person

The name Alternatively, Linus said: that git can mean anything, depending on your mood: Random three-letter combination that is pronounceable, and not actually used by any common UNIX command. Stupid. Contemptible and despicable. Simple. Global information tracker and it actually works for you. if you re in a good mood, Goddamn idiotic truckload of sh*t when it breaks

Linus core goals It must be distributed Disconnected mode of operation Trusted Lieutenants concept Very strong safeguards against corruption, either accidental or malicious Fast merge and search "Take CVS as an example of what not to do; if in doubt, make the exact opposite decision." Linus

What is git Git manages changes to tree of files over time. Git is optimized for: Distributed Development Large files set Complex merges Making trial branches Being very fast Being robust Git is not optimized for: Tracking file permissions and ownership Track individual files with separate history

Usage Concepts Everyone has the commit bit. Send the patch or publish repository. Multiprotocols: git, HTTP and SSH. Everyone has the entire repository. (Disks are cheap) Every ID is based on SHA-1 2 2 160 bits long

Design git is divided in two kind of commands: Porcelain These are high-level commands Used mainly by humans Commands subject to change in order to improve the end user experience. Plumbing Low level commands Used mainly by scripts. Commands are more stable

Facts The overall design is heavily based on pipeline of tools UNIX philosophy. Mostly written in C, with higher level UI in POSIX shell and some Perl/Python/Wish mixture. Every git command is a git-xxxx application 3. Currently more than 130 commands are available. Git doesn t have a specialized built-in help system. Getting Documentation man git-foo git help foo git foo --help 3 git-clone, git-push, git-diff

Concepts Repository Working tree Branch Master repository Tag Head Merge Index 4 4 A concept that appeared in git

Repository A repository is an archive of what the working tree looked like at different times in the past whether on your machine or someone else s.

Working tree The tree of actual checked out files. The working tree is normally equal to the HEAD plus any local changes that you have made but not yet committed. Contains a.git directory.

The.git/config file [core] repositoryformatversion = 0 logallrefupdates = true [remote "origin"] url = ssh://brenohl@speck.ltc.austin.ibm.com/git/fvt/networ fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [gui] geometry = 1399x943+0+25 347 263 [user] name = Breno Leit~ao email = leitao@linux.vnet.ibm.com

Branch A branch starts a new development tree, which is disjoint from the other you ve just cloned.

Branch No single repository is inherently authoritative. Linus s repository is official only by social convention. Everybody can fork and make his own changes. Typically, a branch is used to work on a specific topic.

Master The mainline of development in most repositories is done on a branch master called master. Although this is a typical default, it is in no way special.

Tag A tag is a link to a commit ID. A tag object contains an object, object type, tag name, the name of the person ( tagger ) who created the tag, and a message, which may contain a signature, as can be seen using the git-cat-file.

HEAD The word HEAD refers to the most recent commit of the last branch you checked out. Thus, if you are currently on the master branch, the words master and HEAD would be equivalent. HEAD refers to the previous commit HEAD 2 refers to two commits back in the history.

Merge Consolidate work git uses the 3-way merge algorithm if only one-side changes, take that change. if both sides change to the same result, use it. otherwise it is a conflict. Also applied to paths We currently do merges faster than anybody else

Branches, merges and collision

Index Unlike other, similar tools you may have used, Git does not commit changes directly from the working tree into the repository. Instead, changes are first registered in something called the index. Some find it helpful to call it instead as the staging area, instead of the index.

Flow

Creating the Repo git-init creates the repository. breno@cafe:~/git# git init Initialized empty Git repository in.git/

Adding a file git-add adds a file in the repository or mark it to be considered during the commit breno@cafe:~/git# echo Hello World > hello.txt breno@cafe:~/git# git add hello.txt

Committing git-commit commit the changes you did and added breno@cafe:~/git# git commit -m "My first commit" Created initial commit d4baed6: My first commit 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 hello.txt

Historical changes git-log shows the historical modification in a branch Also supports advance arguments as git log --since="2 weeks ago" --until="yesterday" # git log commit 32ade9636de5eed401fa8c819cc317f4fa795699 Author: Breno Leitao <breno@cafe.(none)> Date: Mon May 12 22:38:17 2008-0300 My second commit commit d4baed65b47fb848f92d814ed149c62d62ca427d Author: Breno Leitao <breno@cafe.(none)> Date: Mon May 12 22:34:37 2008-0300 My first commit

Detailed changes git-show dumps one specific modification, and the patch that provoked the change # git show 32ade9636de5eed401fa8c819cc317f4fa795699 commit 32ade9636de5eed401fa8c819cc317f4fa795699 Author: Breno Leitao <breno@cafe.(none)> Date: Mon May 12 22:38:17 2008-0300 My second commit diff --git a/hello.txt b/hello.txt index 557db03..d3636ff 100644 --- a/hello.txt +++ b/hello.txt @@ -1 +1 @@ -Hello World +Hello World version 2

Differences before committing git-diff shows the diff between the working tree and the repository. # git diff diff --git a/hello.txt b/hello.txt index d3636ff..6913f91 100644 --- a/hello.txt +++ b/hello.txt @@ -1 +1 @@ -Hello World version 2 +Hello World version 3

Git branch git-branch creates, deletes and list branches. breno@cafe:~/git$ git branch newfeature breno@cafe:~/git$ git branch * master newfeature

Git checkout git-checkout checks out a branch breno@cafe:~/git$ git checkout newfeature M hello.txt Switched to branch "newfeature" breno@cafe:~/git$ git branch master * newfeature

Merging branches breno@cafe:~/git$ git checkout master Switched to branch "master" breno@cafe:~/git$ cat hello.txt Hello World version 3 A new line in a new branch Done in master breno@cafe:~/git$ git checkout newfeature Switched to branch "newfeature" breno@cafe:~/git$ cat hello.txt Hello World version 2 breno@cafe:~/git$ git merge master Updating 32ade96..a218c02 Fast forward hello.txt 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) breno@cafe:~/git$ cat hello.txt Hello World version 3 A new line in a new branch Done in master @cafe:~/git$ git branch -d master Deleted branch master.

Front Ends gitk, gitview gitweb tig

Gitk

Git-gui

Git web

tig

END Thank you!