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

Similar documents
GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

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

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

Git. Presenter: Haotao (Eric) Lai Contact:

Git for Subversion users

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

Introduction to distributed version control with git

Software Project (Lecture 4): Git & Github

Version Control: Gitting Started

Version Control. Version Control

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

Software Development I

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

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

Git Basi, workflow e concetti avanzati (pt2)

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

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

Git for Newbies. ComMouse Dongyue Studio

Beyond git add/commit/push

Version Control System - Git. zswu

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

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;

Fundamentals of Git 1

A BASIC UNDERSTANDING OF VERSION CONTROL

b. Developing multiple versions of a software project in parallel

git-flow Documentation

Improving Your Life With Git

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

FEEG Applied Programming 3 - Version Control and Git II

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

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

Lecture 6 Remotes. Sign in on the attendance sheet!

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

CS314 Software Engineering Configuration Management

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

Git tutorial. Katie Osterried C2SM. October 22, 2015

AIS Grid School 2015

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:

Version Control. Version Control

CS 390 Software Engineering Lecture 5 More Git

Software Revision Control for MASS. Git Basics, Best Practices

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

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

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

Algorithm Engineering

The Old World. Have you ever had to collaborate on a project by

Managing Network Configurations with Git and GitLab

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

DEVNET Introduction to Git. Ashley Roach Principal Engineer Evangelist

CSE 391 Lecture 9. Version control with Git

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

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

Version control system (VCS)

Object Oriented Programming. Week 1 Part 2 Git and egit

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

Lab Objective. Lab Assignment. Downloads and Installation

Git version control with Eclipse (EGit) Tutorial

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

Visualizing Git Workflows. A visual guide to 539 workflows

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

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

Git, the magical version control

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

Getting the files for the first time...2. Making Changes, Commiting them and Pull Requests:...5. Update your repository from the upstream master...

Introduction to Version Control

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

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

Lab Exercise Git: A distributed version control system

Computer Science Design I Version Control with Git

Advanced Operating Systems Control Versioning with GIT. Giuseppe Massari

Version Control with Git

Revision Control. An Introduction Using Git 1/15

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

Git: Distributed Version Control

Using GitHub and SourceTree to work with DITA TC repositories

Version Control Systems (VCS)

Introduction to Version Control with Git

Tizen/Artik IoT Practice Part 4 Open Source Development

Git(Lab) Tutorial and Hands-On

Online Remote Repositories

Using Git to Manage Source RTL

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

Revision control. INF5750/ Lecture 2 (Part I)

Version Control with GIT

Accessing OSIRIS and using OSIRIS through GitHub

Version Control with Git

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

Version control with Git.


Git Introduction CS 400. February 11, 2018

Use git rm to remove files from workspace

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

Source Code Management wih git

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

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

VCS VERSION CONTROL SYSTEMS

Introduction to Version Control using Git

תוכנית יומית לכנס התכנסות וארוחת בוקר

Transcription:

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

REVERTING CHANGES 2

REVERTING CHANGES Change local files git reset git checkout Revert a commit in the branch history git revert Reset a file demo in SourceTree 3

STASH ING CHANGES 4

STASH TEMP CHANGES Saves changes to temporary area locally Does not create a commit to the repository Useful for switching to other branches without losing your work Restore the stash when ready to re-apply modifications Stash Demo in SourceTree 5

TAGS 6

TAGS Bookmarks a specific commit Useful for major version numbers Naming Conventions Label with version, Xojo Version, Plugin Versions, OS Version No white space permitted Converted from SVN will have %20 Tag demo in SourceTree 7

BRANCHES 8

BRANCHES Branches are a separate line of development A branch represents the tip of a series of commits Branches are just pointers to commits It's not a container for those commits 9

BRANCHES master is the default branch Help to separate lines of development Merging of branches is where Git excels GitFlow is a popular branching model Ex: Master, HotFix, Develop, Feature, Release 10

BRANCHES $ git checkout master Create and switch to new branch $ git checkout -b <branch> Delete branch $ git branch -d <branch> 11

BRANCH WALK THROUGH First Commit M1 12

BRANCH WALK THROUGH M1 B1 New Branch 13

BRANCH WALK THROUGH M1 B1 B2 Second Branch Commit 14

BRANCH WALK THROUGH M1 B1 B2 B3 Third Branch Commit 15

BRANCH WALK THROUGH M1 B1 B2 B3 B4 Fourth Branch Commit 16

BRANCH WALK THROUGH Merge Branch To Master M1 M2 B1 B2 B3 B4 (Branch Deleted After Merge) 17

DETACHED HEAD REFERENCE HEAD is a reference to latest commit in branch OR a specific commit Internally, the git checkout command simply updates the HEAD to point to either the specified branch or commit. The point is, your development should always take place on a branch never on a detached HEAD. This makes sure you always have a reference to your new commits. What does "detached HEAD" mean, and why should I care? Occurs when you check out a specific commit in a branch versus the latest commit of branch 18

GITFLOW BRANCHING MODEL 19

GITFLOW A successful Git branching model Only branch from and merge to the Master branch Master, HotFix, Release, Development, Features http://nvie.com/posts/a-successful-git-branchingmodel/ 20

GITFLOW: HOTFIX BRANCH First Commit C1 21

GITFLOW: HOTFIX BRANCH Second Commit C1 C2 22

GITFLOW: HOTFIX BRANCH Third Commit C1 C2 C3 23

GITFLOW: HOTFIX BRANCH C1 C2 C3 HF1 HotFix Branch Commit 24

GITFLOW: HOTFIX BRANCH Third (Merge) Commit C0 C1 C2 C3 HF1 25

GITFLOW: HOTFIX BRANCH Fourth Commit C0 C1 C2 C3 C4 HF1 26

REMOTES 27

REMOTE REPOS Local repo on your client only Remote is a Git host to push to You clone, push, fetch and pull from remotes 28

STANDARD GIT WORKFLOW Working Directory Staging Area Repository Remote 29

REMOTE REPOS Network Protocols SSH HTTPS Git Protocol (daemon) 30

SELF-HOSTED REPOS SSH Enable SSH, create bare repository on server Atlassian Stash Enterprise GitHub GitLab 31

REMOTE REPOS 3rd Party GitHub, BitBucket, Google Code CodeSpaces, SourceRepo Assembla, Gitorious And possibly more, I m betting! 32

CLONING A REPOSITORY The process of copying an existing Git repository to your computer A cloned repo includes the entire file history changes and commit messages Git clone command example: $ git clone https://server.edu/reponame.git 33

PUSHING CHANGES $ git push origin master Push (upload) the master branch to the origin remote host First remote is named origin Recommended not to rename this (GUI Apps assume naming convention) 34

GIT 2.0 PUSH DEFAULTS Starting with Git version 2.0 push will default to simple - push only the active branch you are on Previous behavior was to push all matching branches Could be dangerous, might miss that some branches updated without you remembering it $ git config --global push.default simple 35

FETCHING Fetching updates your local Git repo of the remote s status of commits, branches, tags Fetching from remote repo host does not change your local files Use when you want to update what your local Git repo knows about the remote s commits, branches, tags 36

REMOTES DEMO Create remote repo Add remote to local repo settings Local branches tracks remote branches Push full local repo to remote Commit locally, then push to origin remote Local branches and stashes never pushed to remote 37

DEBUGGING TOOLS 38

DEBUGGING WITH GIT File Annotation with git blame Use when you know where a bug is Binary Search with git bisect Very helpful when you can t determine which commit the bug was introduced 39

BISECT - BINARY SEARCH Bisect demo at the command line 40

LESSONS LEARNED 41

LESSONS LEARNED Learn the basics of the command line Helpful for when odd errors occur Access features not always available in GUI Apps 42

LESSONS LEARNED Embrace Branches Init project for GitFlow Use the Develop and HotFix branches to start Very easy to do in SourceTree 43

FOR MORE INFO 44

RESOURCES AND TRAINING Official Git Site http://git-scm.com Git Cheat Sheets Git Pro Book 45

RESOURCES AND TRAINING http://try.github.com http://atlassian.com/git O Reilly McCullough and Berglund on Mastering Git 46

THANK YOU. Justin Elliott jelliott [at] psu.edu! @justindelliott 47