GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

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

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

Version control with Git.

Git for Version Control

CSE 391 Lecture 9. Version control with Git

Version Control: Gitting Started

Revision Control and GIT

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

Version Control with GIT

Git for Newbies. ComMouse Dongyue Studio

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

Git Introduction CS 400. February 11, 2018

Introduction to Git and Github

Version Control Systems

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

Software Project (Lecture 4): Git & Github

Windows. Everywhere else

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

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

Version control. what is version control? setting up Git simple command-line usage Git basics

Git & Github Fundamental by Rajesh Kumar.

EECS 470 Lab 4. Version Control System. Friday, 31 st January, 2014

Using git to download and update BOUT++

Chapter 5. Version Control: Git

Managing Network Configurations with Git and GitLab

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum

Computer Science Design I Version Control with Git

A Brief Introduction to Git. Sylverie Herbert (based on slides by Hautahi Kingi)

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

Git. Presenter: Haotao (Eric) Lai Contact:

DEAD-SIMPLE VERSION CONTROL FOR YOUR TEAM GIT WITH MATTHEW REIDSMA GRAND VALLEY STATE UNIVERSITY

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

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

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

Version Control. Software Carpentry Github s Hello World Git For Ages 4 And Up You need source code control now

So#ware(Project. Lecture'4. Wouter'Swierstra. So#ware(project( (Lecture(4 1

Barry Grant

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

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

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

A BASIC UNDERSTANDING OF VERSION CONTROL

Version control system (VCS)

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

Basics of Git GitHub

L Modeling and Simulating Social Systems with MATLAB

Lab Exercise Git: A distributed version control system


Introduction to 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

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

How to be a 1337 h4ck3r: Git + Linux

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

What is Git? What is Git? Version Control. Barry Grant

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

Version control with git and Rstudio. Remko Duursma

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

How to git with proper etiquette

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

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

Git! Fundamentals. IT Pro Roundtable! June 17, 2014!! Justin Elliott! ITS / TLT! Classroom and Lab Computing!! Michael Potter!

Intro to Github. Jessica Young

Introduction to GIT. Jordi Blasco 14 Oct 2011

Code and data management with Git

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

Human-Computer Interaction Design

GIT DISTRIBUTED IS THE NEW CENTRALISED

Effective Programming Practices for Economists. 7. Version Control, Part II: Git with a Shared Repository

Version Control with GIT: an introduction

From Commits to Collaboration: A Git Tutorial for Social Scientists

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

Submitting your Work using GIT

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

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

Using GitHub to Share with SparkFun a

Version Control System GIT

S18 Modern Version Control with Git

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

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

Agenda. - Final Project Info. - All things Git. - Make sure to come to lab for Python next week

Algorithm Engineering

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

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

Version Control with Git

Software Development I

Fundamentals of Git 1

Git. CSCI 5828: Foundations of Software Engineering Lecture 02a 08/27/2015

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

Version Control System - Git. zswu

F17 Modern Version Control with Git. Aaron Perley

Version Control with Git ME 461 Fall 2018

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

A Practical Introduction to Version Control Systems

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

Version Control with Git

A Brief Git Primer for CS 350

Git Tutorial. Version: 0.2. Anders Nilsson April 1, 2014

Lab 08. Command Line and Git

Assumptions. GIT Commands. OS Commands

CSCE UVM Hands-on Session-1 Pre-Work

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

Transcription:

GETTING STARTED WITH Michael Lessard Senior Solutions Architect June 2017

Agenda What is Git? Installation of Git Git basis Github First steps with Git 2

WHAT IS GIT?

What is Git? Started in 2005 Created by Linus Torvald To aid Linux kernel development Most modern version control system others CVS Subversion Perforce Mercurial Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. https://git-scm.com/ 4

What do you store in Git? Any type of files Ideally, files that will be modified and where you need to keep track of the modifications Config files Puppet receipt Ansible playbook Code 5

Why Git is so popular? Nearly every operation is local Has integrity Everything in Git is check-summed before it is stored Git generally only adds data 6

INSTALLATION OF GIT

Git installation RHEL/CENTOS/FEDORA # yum install git WINDOWS https://git-scm.com/download/win MAC # brew install git 8

GIT BASIS

GIT key concepts 1/2 Snapshots Takes a picture (reference) of what all you files look like at that moment Commit Act of creating a snapshot Contains 3 informations How the files changed from previously A reference to the commit that came before it A hash code name (6aasdfdsfaasdf34..) Repositories (repo) Collection of all the files and the history Consist of all your commits Can live on a local machine or remote (github) The act of copying a repository is called cloning

GIT key concepts 2/2 Branch All commit in git live in some branch The main branch in a project is called the master branch (doesn t have to) Head A reference to the most recent commit (almost always) Origin Git has the concept of "remotes", which are simply URLs to other copies of your repository. When you clone another repository, git automatically creates a remote named "origin" and points to it

The three states Modified File changed but not committed Staged Marked a modified file Committed Data is safely stored

Basic Git workflow 1. You modify files in your working directory. 2. You stage the files, adding snapshots of them to your staging area. 3. You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.

GITHUB

What is Github? www.github.com Largest web-based git repository Allow for code collaboration Add some extra functionality on top of git Funded in 2008 Enterprise edition available Alternatives : Gitlab, Bitbucket,... 15

Most active projects on Github 2016 : https://octoverse.github.com/ 16

LAB - Create an account on Github Go to http://www.github.com and create an account by clicking the Sign up button on the top right. Create a Repository (project) Click on readme than commit the code Click on Clone/Download URL, select use https Copy the link 17

LAB - FIRST STEPS WITH GIT

First steps with git 1/6 Initial configuration of git [mlessard@laptop ~]$ git config --global user.name michael.lessard [mlessard@laptop ~]$ git config --global user.email mlessard@redhat.com [mlessard@laptop ~]$ git config global push.default simple (avoid to specify the branch) [mlessard@laptop ~]$ git config --list 19

First steps with git 2/6 Let s clone the project that we just created on github [mlessard@laptop ~]$ mkdir projects ; cd projects [mlessard@laptop projects]$ git clone https://github.com/michaellessard/testrhug.git Cloning into 'testrhug'... remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. [mlessard@laptop projects]$ ls testrhug [mlessard@laptop projects]cd testrhug [mlessard@laptop testrhug]$ ls README.md 20

First steps with git 3/6 Check the status [mlessard@laptop testrhug]$ git status # On branch master nothing to commit, working directory clean Add a file ( stage the file) [mlessard@laptop testrhug]$ touch mycode.txt [mlessard@laptop testrhug]$ git status On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # mycode.txt nothing added to commit but untracked files present (use "git add" to track) [mlessard@laptop testrhug]$ git add mycode.txt 21

First steps with git 4/6 Commit your change (store the change locally) [mlessard@laptop testrhug]$ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: mycode.txt # [mlessard@laptop testrhug]$ git commit -m "first commited file" [master 7c2a292] first commited file 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 mycode.txt At this point, the new file is committed to the project in my laptop, but not synced up. 22

First steps with git 5/6 Push your change to the remote project [mlessard@laptop testrhug]$ git push Counting objects: 4, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 281 bytes 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To https://github.com/michaellessard/testrhug.git 6145d4e..7c2a292 master -> master 23

First steps with git 6/6 Everyone else who wants to have the latest revision of your project must : - execute a git pull if they already cloned the project or - the git clone URL command to download the whole project Let s now see the result on github.com 24

Some tips and tricks If you want to stage multiple files : $ git add. If you want to see the changelog of your project : $ git log -p, which shows the difference introduced in each commit If you want to cache your github credential : $ git config --global credential.helper 'store --file ~/.my-credentials'