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

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

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

Introduction to distributed version control with git

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

Revision control. INF5750/ Lecture 2 (Part I)

Git(Lab) Tutorial and Hands-On

CS 390 Software Engineering Lecture 5 More Git

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

Version Control System - Git. zswu

How to be a git. Dominic Mitchell

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 for Subversion users

Submitting your Work using GIT

Git Magic: Versioning Files Like a Boss. Tommy MacWilliam

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

Revision Control. An Introduction Using Git 1/15

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

MOOSE-Based Application Development on GitLab

Assumptions. GIT Commands. OS Commands

Git tutorial. Katie Osterried C2SM. October 22, 2015

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

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

Git, the magical version control

Version Control. Version Control

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

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

Git. Presenter: Haotao (Eric) Lai Contact:

Git Introduction CS 400. February 11, 2018

A BASIC UNDERSTANDING OF VERSION CONTROL

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

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

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

Introduction to Version Control

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

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

Version Control: Gitting Started

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

Revision Control and GIT

Lecture 6 Remotes. Sign in on the attendance sheet!

Software Development I

Lab Objective. Lab Assignment. Downloads and Installation

Introduction, Instructions and Conventions

VCS VERSION CONTROL SYSTEMS

Version Control Systems (Part 1)

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

1/20/13 Git tutorial. Git tutorial. Mike Nolta. file:///users/nolta/github/reveal.js/git.html?print-paper#/ 1/31

Version Control with GIT

Git. Ľubomír Prda. IT4Innovations.

Github/Git Primer. Tyler Hague

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

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

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

Fundamentals of Git 1

Version Control. Collaborating with git. Tim Frasier

b. Developing multiple versions of a software project in parallel

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

Visualizing Git Workflows. A visual guide to 539 workflows

Advanced Operating Systems Control Versioning with GIT. Giuseppe Massari

An Overview of Version Control Systems. Guest lecture Juhan Ernits Computer Systems Engineering

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

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

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

Distributed Version Control (with Git)

G E T T I N G S TA R T E D W I T H G I T

AIS Grid School 2015

Git Resolve Conflict Using Mine Command Line

RSARTE Git Integration

Version Control Systems: Overview

Version Control. Version Control

Computer Science Design I Version Control with Git

FEEG Applied Programming 3 - Version Control and Git II

Algorithm Engineering

an introduction to git

Version control with Git.

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

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

TDDC88 Lab 4 Software Configuration Management

Review Version Control Concepts

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

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

Introduction to Git and Github

Version Control Systems

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

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

Using Git to Manage Source RTL

IC Documentation. Release 0.1. IC team

Git tips. Some tips to use Git.

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

CS 320 Introduction to Software Engineering Spring February 06, 2017

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

Managing Network Configurations with Git and GitLab

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

Outline. Version Control System (VCS) basics Git terminology & concepts Basic Git commands Branches in Git Git over the network (time permitting)

Software Revision Control for MASS. Git Installation / Configuration / Use

Chapter 5. Version Control: Git

Source Code Management wih git

Version Control Systems (VCS)

Revision control systems (RCS) and. Subversion

Beyond git add/commit/push

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

Transcription:

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

1 The three W s What? Why? Workflow and nomenclature 2 Overview of gits structure Structure Branches 3 Using git Setting up Working Sharing 4 Final stuff

What is a version control system? A system which monitors data continuously Monitors means that it will detect any changes to the data and will be able to tell you about them. At every point during your work you can tell the system to take a snapshot (a record of the current status of the data). You can let others change your data and these changes will also be recorded. A friend with benefits (on top of the above) Everything is saved with a timestamp and user information (making it easy to pinpoint and blame the source of a mistake). All changes can easily be reverted to any previous state. You can even revert to a previous version, fix an error and automatically redo all the other good stuff!

Why do I need it? Single User: This functionality greatly simplifies the development process of digital products. Especially the development of software. Multi User: Everybody can change whatever he wants, without consulting anybody else. All the modifications by all the different users will be merged to one final result automatically. If they don t overlap. Different branches are supported.they enable you to work on a specific subproblem separately. Of course, these can later be merged without trouble. If they don t overlap.

Workflow - Commit

Workflow - Commit

Workflow - Checkout

Workflow - Merge

Workflow - Branches

Git is a distributed RCS

Working Copy - Index - Repository Working Directory Index Repository checkout add reset commit

Branches How do they work? different versions of the same overall functionality (overlaps) experimental stuff, tryouts parallel development on the same trunk What branches do I have and why: Run git branch -a Git keeps copies of all branches on your source repository marked with a remotes/ prefix. If you run the git fetch command, these local copies will be updated. git fetch makes changes from a different repository available in your repository. You can create new remotes with the git remote command. You can set an alias (as origin in the cloned case). The branches marked as remotes/ can not be checked out. You have to create a local branch which tracks the remote one. Tracking means, that git pull and git push will use these branches as a default.

Branches - workflow example: new features & multi users Testing V1 V2 V3 branch merge merge Master V1 V2 V3 V4 V5 commits

Branches - workflow example: different versions microwave V1 V2 V3 branch merge oven V1 V2 V3 V4 V5 branch merge grill V1 V2 V3

Using git: Setting up Configuring Git Run: git config --global user.name "Bob" git config --global user.email "bob@bob.com" Setting up a local repository git init Copying (Cloning) an existing repository git clone GIT-URL Possible GIT-URLs (only ssh and local shown): ssh://[user@]host.xz[:port]/path/to/repo.git/ [user@]host.xz:path/to/repo.git/ /path/to/repo.git/

Using git: working The git checkout command Checks out a branch: Sets your repository (called the HEAD) to the last commit of the branch, sets your index and your working directory to the desired branch data. Important Command line argument: -b Create a new branch and switch to it The git add command Puts local changes into the index on a file by file basis. The git diff command Shows the difference between your working copy and the index. The git status command Shows the current status of your working directory, index and repository.

Using git: working The git commit command Puts the changes in the index into the repository creating a new checkpoint (commit). Important Command line argument: -a Includes adding all changes to the index. The git branch command Creates a new branch or shows the existing branches. Important Command line arguments: -a Shows all existing branches -d Deletes a branch (verifying that the changes are in the current branch) -D Delete a branch without verifications Example: git branch my_testing remotes/origin/testing creates a new local branch named my testing which is tracking the branch named testing on the origin repository.

Using git: working The git merge command Normally you will use it to merge a branch you will abandon back into your main branch. To do that, checkout the main branch and do git merge soon-to-be-abandoned-branch If there are conflicts (the two branches differ in the same line), git will leave conflict markers. They look like this: <<<<<<< master Content of line x in branch master ======= Content of line x in branch local >>>>>>> local Resolve them and commit the result! The gitk command This will show a nice graphical representation of your repository, the branches and their relations. A good alternative for Mac OS X is GitX which can be found on MacPorts.

Using git: sharing The git pull command Consists of the git fetch and the git merge command as follows The first parameter can be a repository GIT URL. It is used to fetch from. The results are normally stored in the local remotes/remote-alias/ branches. The second parameter is the branch on the foreign repository to be used in the merge command. If you ve set up your tracking branches, git will automatically know all of the above and a git pull without any arguments updates your local branch to the respective branch on the remote repository. This command always modifies the currently checked out branch! Of course this could cause merge conflicts...

Using git: sharing The git push command Tries to update a branch on a remote repository. Normally works only for fast forwards, i.e. merges with no conflicts (there are good reasons) You can force a push, but if you do, it will NOT do a merge! If the push doesn t work, the normal procedure would be to do a pull first, resolve the problems and then push the new commit, which is then directly descendent from the current status on the repository. Nice feature: hooks You can make interesting things happen to a repository every time you push into it... - http://www.kernel.org/pub/software/scm/git/docs/git-push.html

Using git: advanced git commands The git rebase command Rewriting of history Squashing of commits Creating a linear history The git grep command Improved searching in repositories Follows the same basic syntax as Unix grep The git stash command Puts your changes to a safe place and resets the working directory and index Handy for quick looks into different branches without having to create a commit

Final stuff Of course there are many more really useful commands you should use, please discover them on your own. References I used: http://book.git-scm.com/index.html http://www.kernel.org/pub/software/scm/git/docs/git.html Take-Home-Message USE GIT