OUTLINE. Introduction and vocabulary Basic git model Basic git workflow Git clients Git branching model Summary

Similar documents
Version control systems. Lecture 2

Introduction to the Git Version Control System

MATLAB & Git Versioning: The Very Basics

Version Control using Git and Github. Joseph Rivera

Gitflow process. Adapt Learning: Gitflow process. Document control

Git Basics. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 22

MOOSE-Based Application Development on GitLab

Version Uncontrolled! : How to Manage Your Version Control

Using Git for Project Management with µvision

Two Best Practices for Scientific Computing

Introduction to Version Control with Git

Source Control Systems

CPSC 491. Today: Source code control. Source Code (Version) Control. Exercise: g., no git, subversion, cvs, etc.)

Work. MATLAB Source Control Using Git

Introduc)on to Version Control with Git. Pradeep Sivakumar, PhD Sr. Computa5onal Specialist Research Compu5ng, NUIT

Version Control. Version Control

Version Control for Computational Economists: An Introduction

Introducing Xcode Source Control

Version Control with. Ben Morgan

Advanced Computing Tools for Applied Research Chapter 4. Version control

An Introduction to Mercurial Version Control Software

Version Control! Scenarios, Working with Git!

Git, GitHub & Web Hosting Workshop

Version Control with Git

Annoyances with our current source control Can it get more comfortable? Git Appendix. Git vs Subversion. Andrey Kotlarski 13.XII.

Version Control with Git. Kate Hedstrom ARSC, UAF

Using Git for Centralized and Distributed Version Control Workflows - Day 3. 1 April, 2016 Presenter: Brian Vanderwende

Data management on HPC platforms

CS 2112 Lab: Version Control

Version Control with Git

CSCB07 Software Design Version Control

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

Continuous Integration. CSC 440: Software Engineering Slide #1

Introduction to Version Control with Git

Version Control with Svn, Git and git-svn. Kate Hedstrom ARSC, UAF

Distributed Version Control

Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

Revision control systems (RCS) and

Version Control with Git. Linux Users Group UT Arlington. Rohit Rawat

FEEG Applied Programming 3 - Version Control and Git II

CISC 275: Introduction to Software Engineering. Lab 5: Introduction to Revision Control with. Charlie Greenbacker University of Delaware Fall 2011

Version control. with git and GitHub. Karl Broman. Biostatistics & Medical Informatics, UW Madison

The Bazaar Version Control System. Michael Hudson, Canonical Ltd

Improving your Drupal Development workflow with Continuous Integration

Content. Development Tools 2(63)

Automatic promotion and versioning with Oracle Data Integrator 12c

Introduction to Version Control

Software configuration management

Zero-Touch Drupal Deployment

Git Basics. Christian Hanser. Institute for Applied Information Processing and Communications Graz University of Technology. 6.

CSE 374 Programming Concepts & Tools. Laura Campbell (Thanks to Hal Perkins) Winter 2014 Lecture 16 Version control and svn

Unity Version Control

Version control with Subversion

An Introduction to Mercurial Version Control Software

Version Control Systems

Version control. HEAD is the name of the latest revision in the repository. It can be used in subversion rather than the latest revision number.

SVN Starter s Guide Compiled by Pearl Guterman June 2005

Version Control Tutorial using TortoiseSVN and. TortoiseGit

Lab Exercise Part II: Git: A distributed version control system

Technical Writing - Advantages of Version Control Systems

Using GitHub for Rally Apps (Mac Version)

Developer Workshop Marc Dumontier McMaster/OSCAR-EMR

Version Control Systems: SVN and GIT. How do VCS support SW development teams?

Version Control Systems (Part 2)

Version Control Using Subversion. 12 May 2013 OSU CSE 1

Version Control with Git. Dylan Nugent

Palantir.net presents Git

Miguel A. Figueroa Villanueva Xabriel J. Collazo Mojica

Subversion Integration for Visual Studio

Master s Thesis. git-sprite: Supporting Tool for Pull-Based Software Development Model. Yusuke Saito

Git - Working with Remote Repositories

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

Version Control and Subversion. Dr Paul Tennent

PKI, Git and SVN. Adam Young. Presented by. Senior Software Engineer, Red Hat. License Licensed under

Using SVN to Manage Source RTL

Version Control. Luka Milovanov

Working Copy 1.4 users manual

Software Configuration Management. Slides derived from Dr. Sara Stoecklin s notes and various web sources.

Using Subversion in Computer Science

Distributed Version Control with Mercurial and git

The Hitchhiker s Guide to Github: SAS Programming Goes Social Jiangtang Hu d-wise Technologies, Inc., Morrisville, NC

Miguel A. Figueroa Villanueva Xabriel J. Collazo Mojica. ICOM 5047 Capstone Miguel A. Figueroa Villanueva University of Puerto Rico Mayagüez Campus

Subversion. Nadir SOUALEM. Linux Users subversion client svn or higher. Windows users subversion client Tortoise 1.6.

How to Create a Free Private GitHub Repository Educational Account

Software Configuration Management and Continuous Integration

Intro etckeeper bup ikiwiki git-annex vcsh mr Zsh Outro. Gitify your life. web, blog, configs, data, and backups

Using SVN to Manage Source RTL

Using Git with Rational Team Concert and Rational ClearCase in enterprise environments

Version control with GIT

Software Delivery Integration and Source Code Management. for Suppliers

Source code management systems

Version Control with Mercurial and SSH

Putting It All Together. Vagrant Drush Version Control

Mobile Development with Git, Gerrit & Jenkins

Implementing Continuous Integration and Cloud Server Infrastructure for an International Enterprise Based In Finland

COSC Software Engineering. Lecture 7: Version Control

Jazz Source Control Best Practices

Source Control Guide: Git

Continuous Integration

An Introduction to Git Version Control for SAS Programmers

Transcription:

VERSION CONTROL SYSTEMS - GIT Boyu Zhang Research Computing Purdue University 1

OUTLINE Introduction and vocabulary Basic git model Basic git workflow Git clients Git branching model Summary 2

VERSION CONTROL WHAT IS VERSION CONTROL A system that records changes to a file or set of files over time so that you can recall specific versions later Users do not need to make duplicates of files, you can go back in time for files that are under version control You are using version control without noticing! Copy files into another directory in your local/remote workstation 3

VERSION CONTROL LOCAL VERSION CONTROL SYSTEMS A system that records changes to a file or set of files over time so that you can recall specific versions later Users do not need to make duplicates of files, you can go back in time for files that are under version control Version control in different forms Local version control systems rcs A simple database that keeps all the changes to files Everything is stored locally on your workstation If the disk fails, you are out of luck Difficult for collaborations among developers 4

VERSION CONTROL CENTRALIZED VERSION CONTROL SYSTEMS A system that records changes to a file or set of files over time so that you can recall specific versions later Users do not need to make duplicates of files, you can go back in time for files that are under version control Version control in different forms Centralized version control systems subversion A single server stores all the versioned files Multiple clients that check out files Solved the issues of collaboration The central server is the single point of failure 5

VERSION CONTROL DISTRIBUTED VERSION CONTROL SYSTEMS A system that records changes to a file or set of files over time so that you can recall specific versions later Users do not need to make duplicates of files, you can go back in time for files that are under version control Version control in different forms Distributed version control systems git A single or multiple servers store all files Clients have their own local repository If the server dies, any of the clients repositories can be copied to the server to restore it 6

ONLINE LEARNING RESOURCES BOOKS, TUTORIALS, CHEAT SHEETS ETC Free online book: https://git-scm.com/book/ Git website: https://git-scm.com Git tutorials: https://www.atlassian.com/git/tutorials/ Learn git online: http://pcottle.github.io/learngitbranching/ Git cheat sheet: https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf http://ndpsoftware.com/git-cheatsheet.html Git hosts: https://github.com https://bitbucket.org https://github.rcac.purdue.edu (for Purdue only) 7

BASIC GIT MODEL DISTRIBUTED Clients fully mirror the repository Every clone is a full back up clone creates a copy of the repository to one s local machine 8

BASIC GIT MODEL SNAPSHOTS, NOT DIFFERENCES Treats its data (version controlled files) as a stream of snapshots Every version is a snapshot of all files (with optimizations) 9

BASIC GIT MODEL NEARLY EVERY OPERATION IS LOCAL Most operations only need local files and resources to operate Only a few operations interact with the remote repository (e.g., clone, pull, push) 10

BASIC GIT MODEL THREE LOCAL SECTIONS OF A GIT PROJECT Working directory A single checkout of one version of the project Staging area Stores information on what will go into your next commit Git directory Stores the repo metadata and database Files are ready to be pushed to remote repo Unmodified/modified Files Staged Files Basic git workflow Modify files in your working directory Stage files, adding snapshots to the staging area Commit files, take the files in the staging area and store them permanently to the git directory, which are ready to be pushed to the remote git repo 11 Committed Files

BASIC GIT MODEL GIT FILE LIFECYCLE Untracked the file is not under version control Unmodified the file is under version control, with no edit Modified the file is under version control, with some edits Staged the file is under version control, ready to commit Check the status of your files: git status 12

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Create a new git repository from any git host servers 13

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Clone a local copy of a repo from an already existing repo 14

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Clone a local copy of a repo from an already existing repo git clone url [dir] 15

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Check the status of your personal repo 16

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Check the status of your personal repo git status It is a good habit to do this often! 17

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Make your changes vim README.md git status 18

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Make your changes vim README.md git status 19

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Commit your changes The first time we ask a file to be tracked, and every time before we commit a file we must add it to the staging area git add README.md git commit m commit message 20

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Commit your changes The first time we ask a file to be tracked, and every time before we commit a file we must add it to the staging area 21

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Push your changes to remote (the server) Good practice: Add and commit your changes to your local repo Pull from remote to get most recent changes (fix conflicts if necessary, add and commit again to you local repo) Push your changes to the remote repo 22

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH Push your changes to remote (the server) Good practice: Add and commit your changes to your local repo Pull from remote to get most recent changes (fix conflicts if necessary, add and commit again to you local repo) Push your changes to the remote repo git pull origin master git push origin master 23

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH In theory, every thing should work perfectly! In reality 24

BASIC GIT WORKFLOW CREATE OR CLONE, MODIFY, COMMIT, PUSH In theory, every thing should work perfectly! In reality any thing can go wrong! How to resolve conflicts How to go back to the previous commits How to use the branching model to mange development, bug fix, and release How to hide you current work without committing it 25

GIT CLIENTS SOURCETREE 26

GIT CLIENTS COMMAND LINE 27

GIT BRANCHING MODEL COLLABORATIVE PROJECTS MANAGEMENT Main branches Master Production-ready state Develop The latest delivered changes for the next release Supporting branches Feature Branch off and merge into develop branch Release Branch off develop and merge into develop and master Hotfixes Branch off master and merge into develop and master 28 V. Driessen: A Successful Git Branching Model, h;p://nvie.com/posts/a-successful-git-branching-model/

TAKE AWAY SIX GIT COMMANDS TO GET STARTED git clone url [dir] git status git add file git commit m commit message git pull origin master git push origin master 29