Git. Ľubomír Prda. IT4Innovations.

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

Computer Science Design I Version Control with Git

Version control with Git.

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

Git for Version Control

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

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

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

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

Version Control System - Git. zswu

Introduction to distributed version control with git

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

Distributed Version Control (with Git)

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

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

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

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

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

Chapter 5. Version Control: Git

Source Code Management wih git

Algorithm Engineering

Version Control with GIT

Version Control: Gitting Started

1. Git. Robert Snapp

Git Introduction CS 400. February 11, 2018

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

CSE 391 Lecture 9. Version control with Git

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

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

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

CS 390 Software Engineering Lecture 5 More Git

Gitting things done. Hands-on introduction to git niceties. Jan Urbański Ducksboard

VCS VERSION CONTROL SYSTEMS

Best Practices. Joaquim Rocha IT-DSS-TD

git Version: 2.0b Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command:

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

Submitting your Work using GIT

Fundamentals of Git 1

Laboratorio di Programmazione. Prof. Marco Bertini

Basics of Git GitHub

Software Development I

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

Contribute To Linux Mainline

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

INET

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

Introduction, Instructions and Conventions

Version Control for the 2- Pizza Team: Merge Conflicts (ELLS 9.5) Armando Fox

Git version control with Eclipse (EGit) Tutorial

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

Being More Productive with Git

Introduction to GIT. Jordi Blasco 14 Oct 2011

Git. Presenter: Haotao (Eric) Lai Contact:

Git for Subversion users

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

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

Version Control with Git

Version Control with Git

Introduction to Version Control

Git - A brief overview

Git for Newbies. ComMouse Dongyue Studio

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

Git: Distributed Version Control

Advanced Git. Luc Sarzyniec. Xilopix, February / 88

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

Git(Lab) Tutorial and Hands-On

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

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

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

Git: Distributed Version Control

How to be a git. Dominic Mitchell

Version Control Systems (VCS)

From Commits to Collaboration: A Git Tutorial for Social Scientists

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

GIT for companies Mark Struberg, INSO TU Vienna

A BASIC UNDERSTANDING OF VERSION CONTROL

AIS Grid School 2015

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

LAB MANUAL GIT BY PRATIK JAIN. To start with git bash, we need to authenticate ourselves so that for every commit, git can use this information.

Git Basi, workflow e concetti avanzati (pt2)

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

Human Version Control

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

Version Control. Version Control. Human Version Control. Version Control Systems

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

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

GIT CHEAT SHEET. CONFIG --global => write to ~/.gitconfig, otherwise to.git/config. git config [--global] -l git config [--global] -e

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

Introduction to Git and Github Repositories

Git for (not-so) dummies

2 Initialize a git repository on your machine, add a README file, commit and push

Revision control. INF5750/ Lecture 2 (Part I)

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

a handful of Git workflows for the agilist steven harman twitter: stevenharman

Basic git. Interactive.

Lecture 6 Remotes. Sign in on the attendance sheet!

Barry Grant

Using git to download and update BOUT++

Lab Objective. Lab Assignment. Downloads and Installation

Version Control with GIT: an introduction

Transcription:

Git Ľubomír Prda IT4Innovations lubomir.prda@vsb.cz support@it4i.cz

VCS Version Control System Versioning - creation and management of multiple releases of a product, all of which have the same general function but are improved, upgraded or customized. We need VCS for History tracking. Who? When? What? Fast roll-back to previously working version Natural back-up Merging changes from large number of contributors Environment management (testing, stable, LTS) Hot-fix deployment

VCS Version Control System Revision (commit) base unit of versioning. Singular logical result of work Version set of logically aggregated commits based on some key (weekly version, beta version, free version) A good commit is Bug fix New feature Functionality, that cannot be logically split Change, that might be rolled back

Git - the stupid content tracker Git 2005 Linus Torvalds Terminal based VCS Focus on non-linear development, speed and huge projects Designed for development of Linux kernel Can version anything Garbage accumulated until collected Uses well established protocols for security (ssh, https) Objects identified as SHA-1 hashes of its content. In case of commits also all of its history. 3 data types: BLOB, TREE, COMMIT (bd9dbf5aae1a3862dd1526723246b20206e5fc37)

# <apt yum> install git Setting it up # export GIT_AUTHOR_NAME="Name Surname" # export GIT_AUTHOR_EMAIL=superdud@email.com # export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" # export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" # git config --global color.ui auto # git config --global core.editor vim # git config --global core.editor gedit -w Settings are stored in $HOME/.gitconfig allow environment forwarding or use tools like sshrc if you commit from a shared machine

Let s begin # git init / git clone <URL> # git status // use every time, you do not know what to do # git add <PATH> // select files to take snapshot from # git add <PATH> --patch // select individual lines # git diff [--cached] // see, what you are commiting # git commit // create the snapshot # git commit am Commit message

Branching Branch - named pointer to a revision. Name HEAD is reserved and pointing to a revision/branch, that is currently worked on # git checkout -b <NAME> // create new branch named NAME # git checkout <NAME> // switch current branch to NAME # git checkout <NAME> <PATH> // switch just one file to look like the one in branch/revision NAME # git checkout = I want my files to look, like they look in branch/revision NAME # git branch [-v] // list branches # git merge <NAME> // merge branch into current one

Collision and history Collision happens when 2 people try to edit the same part of a document/code. Git does not know, how to merge them and lets the merging user decide, what to do. Just use git status # git log // just see, what has been done # git log --oneline --decorate # git log --oneline --graph # git log <PATH> # git log --grep <PATTERN> # git show [NAME] // see changes done to files # git blame [PATH] // see who changed a file, line by line

Rewind, shuffle, edit WARNING!! Following commands are destructive. To be used only on private branches. Changing the history changes all commits up to the latest including their SHA1 identifier # git reset <NAME> // rewind current branch back to NAME # git reset --hard <NAME> # git reset --soft <NAME> # git rebase <NAME> // append all changes done in this branch to another branch # git rebase --interactive <NAME> // interactively edit all commits done after NAME

Remote repository # git remote add <NAME> <URL> // add remote repository info to local repository Default remote repository is called origin Cloning remote repository automatically adds it as origin # git fetch // get updates from remote repository # git pull // fetch and merge remote changes into local repository # git pull --rebase // replace local repository with remote version and append local changes to the end # git push [--force] // upload local changes to remote repository

Git Thank you for your attention! Ľubomír Prda IT4Innovations