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

Similar documents
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

Version Control: Gitting Started

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

Git for Version Control

Version control with Git.

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Git. Presenter: Haotao (Eric) Lai Contact:

A BASIC UNDERSTANDING OF VERSION CONTROL

GUIDE TO MAKE A REAL CONTRIBUTION TO AN OPEN SOURCE PROJECT 1. 1

Git tutorial. Katie Osterried C2SM. October 22, 2015

Beyond git add/commit/push

Computer Science Design I Version Control with Git

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

GETTING TO KNOW GIT: PART II JUSTIN ELLIOTT PENN STATE UNIVERSITY

CSE 391 Lecture 9. Version control with Git

CS 390 Software Engineering Lecture 5 More Git

Version Control. Version Control

Ingegneria del Software Corso di Laurea in Informatica per il Management (D)VCS. Davide Rossi Dipartimento di Informatica Università di Bologna

Using git to download and update BOUT++

GIT. A free and open source distributed version control system. User Guide. January, Department of Computer Science and Engineering

Fundamentals of Git 1

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


Git Introduction CS 400. February 11, 2018

Revision Control and GIT

AIS Grid School 2015

Introduction to Version Control with Git

Version Control with GIT

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

License. Introduction to Version Control with Git. Local Version Control Systems. Why Use Version Control?

Revision Control. An Introduction Using Git 1/15

Version Control. Version Control

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

Revision control. INF5750/ Lecture 2 (Part I)

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

Introduction to distributed version control with git

Managing Network Configurations with Git and GitLab

Introduction to Version Control

KTH Royal Institute of Technology SEMINAR 2-29 March Simone Stefani -

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

Git. SSE2034: System Software Experiment 3, Fall 2018, Jinkyu Jeong

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

Git for Newbies. ComMouse Dongyue Studio

Version Control System - Git. zswu

GIT for companies Mark Struberg, INSO TU Vienna

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

Welcome! Virtual tutorial will start at 15:00 GMT. Please leave feedback afterwards at:

Source Code Management wih git

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

February 2 nd Jean Parpaillon

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

CS314 Software Engineering Configuration Management

Version Control Systems. Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University

Project Management. Overview

Introduction to Git and Github Repositories

A Practical Introduction to Version Control Systems

Git for Subversion users

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

Software Project (Lecture 4): Git & Github

MOOSE-Based Application Development on GitLab

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

Git(Lab) Tutorial and Hands-On

Improving Your Life With Git

A quick (and maybe practical) guide to Git and version control. By Jay Johnson

! #Running this command from the top directory of your project will add all your changes."! $ git add."

2/8/18. Overview. Project Management. The First Law. What is Project Management? What Are These Changes? Software Configuration Management (SCM)

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

Git. Ľubomír Prda. IT4Innovations.

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

Visualizing Git Workflows. A visual guide to 539 workflows

Version Control with Git

Git & Github Fundamental by Rajesh Kumar.

CSC 2700: Scientific Computing

Algorithm Engineering

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY

Accessing OSIRIS and using OSIRIS through GitHub

VCS VERSION CONTROL SYSTEMS

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

1. Which of these Git client commands creates a copy of the repository and a working directory in the client s workspace. (Choose one.

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

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

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

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

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

Introduction to Git. Database Systems DataLab, CS, NTHU Spring, 2018

git-flow Documentation

Lecture 6 Remotes. Sign in on the attendance sheet!

b. Developing multiple versions of a software project in parallel

[Software Development] Development Tools. Davide Balzarotti. Eurecom Sophia Antipolis, France

Laboratorio di Programmazione. Prof. Marco Bertini

CS 320 Introduction to Software Engineering Spring February 06, 2017

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

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

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

INET

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

API RI. Application Programming Interface Reference Implementation. Policies and Procedures Discussion

Version Control. So#ware Quality Quality Audit and Cer2fica2on. Master in Computer Engineering. Roberto García

Version Control Systems

GIT TUTORIAL. Creative Software Architectures for Collaborative Projects CS 130 Donald J. Patterson

Transcription:

Git Git 1

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

Introduction to Git Git 3

Version control systems The source files of a project changes over time (addition of functionality, error correction) Version control systems allow you to store and, if necessary, recover all significant versions of the sources in a repository Comparison with previous versions Reverting to a previous version (rollback) Git 4

Version control systems There are 3 types of version control systems: Local, repository on the local machine RCS Centralised, repository on a remote machine CVS Subversion (svn) Distributed, repository on several machines (some may act as servers) Git Mercurial Git 5

What is Git? Distributed (Decentralized) version control system Users keep entire code and history on their local machines Users can make any changes without internet access (Except pushing and pulling changes from a remote server) Started in 2005 Created by Linus Torvald (the creator of the Linux kernel) to aid in Linux kernel development Git 6

Who uses Git Git 7

Git workflows Git 8

Centralised workflow Git 9

Centralised workflow One central repository can accept code, and everyone synchronizes their work to it. A number of developers are nodes and synchronize to that one place. Git 10

Integration-Manager Workflow Git 11

Integration-Manager Workflow Process: 1. The project maintainer pushes to a public repository (blessed repository). 2. A contributor clones that repository and makes changes. 3. The contributor pushes to his own public copy. 4. The contributor sends the maintainer an email asking him to pull changes. 5. The maintainer adds the contributor s repo as a remote and merges locally. 6. The maintainer pushes merged changes to the main repository. Git 12

Dictator and Lieutenants Workflow Git 13

Dictator and Lieutenants Workflow Process: 1. Regular developers work on their topic branch and rebase their work on top of master. The master branch is that of the reference directory to which the dictator pushes. 2. Lieutenants merge the developers' topic branches into their master branches 3. The dictator merges the lieutenants master branches into his master branch 4. The dictator pushes his master to the blessed repository so the other developers can rebase on it. Git 14

Remote repositories "In-House" Hosted Github BitBucket GitLab Git 15

Git key concept Git 16

Snapshots The way Git keeps track of your code history Essentially records what all your files look like at a given point in time You decide when to take a snapshot, and of what files The staging area or index is a file that stores information about what will go into the snapshot Have the ability to go back to visit any snapshot Your snapshots from later on will stay around, too Git 17

Commit The act of creating a snapshot Can be a noun or verb I commited code I just made a new commit A project is made up of a set of commits Commits contain three pieces of information: Information about how the files changed from the previous commit A reference to the commit that came before it (called the parent commit) A hash code name that identifies the commit Git 18

Repository A collection of all the files and the history of those files Consists of all your commits Place where all your work is stored Can live on a local machine or on a remote server (GitHub, Bitbucket, GitLab) The act of copying a repository from a remote server is called cloning Cloning from a remote server allows teams to work together The process of downloading commits that don t exist on your machine from a remote repository is called pulling changes The process of adding your local changes to the remote repository is called pushing changes Git 19

Branches All commits in git live on some branch But there can be many, many branches The main branch in a project is called the master branch Git 20

Branches Git 21

What is a Git project? A set of commits linked together that live on some branch, contained in a repository. Git 22

Hands on session Git 23

Install Git Linux (Debian) Command: sudo apt-get install git Linux (Fedora) Command: sudo yum install git Mac http://git-scm.com/download/mac Windows http://git-scm.com/download/win Git 24

Configuration Identity git config --global user.name "John Doe" git config --global user.email johndoe@example.com Creating/Initializing repository git init Cloning a remote repository git clone <url_repository> Git 25

Common commands Add new file into the index (staging area) git add README.txt Remove file from the index (staging area) git rm file.c Commit changes git commit m "First commit" Updates files in the working tree to match a given commit git checkout <id_commit> Git 26

Common commands Show log (commit history) git log Show commit changes git show <commit_hash> Show diffs between the index and the previous commit (HEAD) git diff Git 27

Undoing things Unmodify modified file in the index git checkout file.c Revert a commit git revert <commit_hash> Git 28

Commands for remote repositories Push to remote repository git push origin <branch_name> Fetch from remote repository git fetch Merge fetched content git merge origin/<branch_name> Fetch & Merge git pull Git 29

Branch management Create new branch git branch <branch_name> Switch branch git checkout <branch_name> Delete branch git branch -d <branch_name> Show all branches git branch Git 30

Git fundamental commands Git 31 (credit: http://krishnaiitd.github.io/gitcommands/ )

Additional info Git official site https://git-scm.com/ Git 15 minutes tutorial https://try.github.io/levels/1/challenges/1 Git cheat sheet https://services.github.com/on-demand/downloads/github-gitcheat-sheet.pdf Git 32

Branching models Git 33

GitFlow GitFlow is a branching model for Git created by Vincent Driessen More info: https://datasift.github.io/gitflow/introducinggitflow.html http://nvie.com/posts/a-successful-git-branching-model/ (Author of the pictures: Vincent Driessen) Original blog post: http://nvie.com/ Git 34

GitFlow 1. New development (new features, non-emergency bug fixes) are built in feature branches Git 35

GitFlow 2. Feature branches are branched off of the develop branch, and finished features and fixes are merged back into the develop branch when they re ready for release Git 36

GitFlow 3. When it is time to make a release, a release branch is created off of develop 4. Test of the release branch Git 37

GitFlow 5. When the release is finished, the release branch is merged into master and into develop Git 38

GitFlow 6. The master branch tracks released code only. The only commits to master are merges from release branches and hotfix branches. Hotfix branches are used to create emergency fixes 7. Hotfix branches are branched directly from a tagged release in the master branch, and when finished are merged back into both master and develop. Git 39

Trunk Based Development Git 40

Trunk Based Development We have two main branches: trunk and release Developers commit to a single trunk more or less exclusively Release engineers (or build-cop) create branches, and cherrypick to branches more or less exclusively Only if a defect cannot be reproduced on trunk, is permission given to fix it on the release branch, and cherry-pick back to trunk. Trunk Based Development means regular developers don t commit to a release branch. Trunk Based Development means you re going to delete old release branches, without merging them back to trunk More info: http://paulhammant.com/2013/04/05/what-is-trunkbased-development/ Git 41