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

Similar documents
A BASIC UNDERSTANDING OF VERSION CONTROL

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

Introduction to Version Control with Git

Version Control with GIT

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

CS 390 Software Engineering Lecture 5 More Git

Version Control: Gitting Started

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

Using git to download and update BOUT++

CS 390 Software Engineering Lecture 4 - Git

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

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

Algorithm Engineering

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

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

Git tutorial. Katie Osterried C2SM. October 22, 2015

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

Version Control Systems

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

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

Software Revision Control for MASS. Git Basics, Best Practices

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

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

Accessing OSIRIS and using OSIRIS through GitHub

Revision Control. An Introduction Using Git 1/15

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

Software Project (Lecture 4): Git & Github

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

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

A brief introduction to the GitLab service at the department

Software Development I

Introduction to Version Control

Git & Github Fundamental by Rajesh Kumar.

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

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

Git. Presenter: Haotao (Eric) Lai Contact:

Git Introduction CS 400. February 11, 2018

VCS VERSION CONTROL SYSTEMS

Managing Projects with Git

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

Version Control for Fun and Profit

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

Submitting your Work using GIT

Version Control. Version Control

Intro to Github. Jessica Young

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

Use git rm to remove files from workspace

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

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

Git for Version Control

Introduction to distributed version control with git

Managing Network Configurations with Git and GitLab

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

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

Technology Background Development environment, Skeleton and Libraries

Version control with Git.

Fundamentals of Git 1

1. Git. Robert Snapp

Revision control Advanced git

CSE 391 Lecture 9. Version control with Git

L Modeling and Simulating Social Systems with MATLAB

Git, the magical version control

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

Revision control. INF5750/ Lecture 2 (Part I)

CSCE UVM Hands-on Session-1 Pre-Work

Improving Your Life With Git

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

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

A Brief Git Primer for CS 350

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

INET

AIS Grid School 2015

Version control system (VCS)

Lecture 6 Remotes. Sign in on the attendance sheet!

Tools for software development:

Version Control with Git

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

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

Git for Newbies. ComMouse Dongyue Studio

Assumptions. GIT Commands. OS Commands

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

Online Remote Repositories

API RI. Application Programming Interface Reference Implementation. Policies and Procedures Discussion

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

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

Version Control. Version Control

Intermediate Programming, Spring Misha Kazhdan

How to be a 1337 h4ck3r: Git + Linux

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

Version Control Systems

Tools. SWE 432, Fall Design and Implementation of Software for the Web

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.

Introduction to Git and Github

Git version control with Eclipse (EGit) Tutorial

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

F17 Modern Version Control with Git. Aaron Perley

Lab Exercise Git: A distributed version control system

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

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

Tutorial 2 GitHub Tutorial

Transcription:

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

http://xkcd.com/1597/ 2

Tutorial Objectives Fundamentals of how git works Everything you need to complete A0 Some best practices Useful Commands 3

Version Control Systems Goal of a Version Control System - Software that manages changes that you make to your files (source code). - Track versions of each file (more accurately, versions of sets of changes to your files). - Handles concurrent changes from multiple sources (e.g. different developers working on the same code base). - Typically central repository stores every version of every file. 4

Distributed Version Control Distributed version control systems (DVCS) - No central server required! - Every user has a copy of every file. We use Git, a very popular DVCS. - Developed in 2005, to manage development for the Linux kernel (Bitkeeper -> Git) - Very specific design goals Large-scale development Distributed Git doesn t require a server, but it s common to use one for coordination e.g. Github 5

Concepts Working directory - your local copy of the files that you re working with. Staging area - a place where you tell Git to hold a set of changes, temporarily. Repository - a place where Git stores copies of your files and their history. Local repository: on your working machine Remote repository: a server (e.g. GitHub) 6

7

Commands You perform these operations using a Git client (command-line or GUI, the work the same). Commands typically move files between working directory, staging area and local or remote repository. 8

Installing Git Before anything else, you need to install and configure Git. Install a Git client (command-line or GUI) - https://git-scm.com/downloads Setup your email address for Git: git config --global user.email "your_email@example.com" 9

Working on A0 Get a copy of the repository from the server git clone https://username@git.uwaterloo.ca/cs349-fall2017/usernam e.git Use git clone to get a copy of starting code from remote repository to your working directory: Work on the assignment Save and commit your changes to git Push changes to the server 10

Working on A0 Get a copy of the repository from the server Work on the assignment Save and commit your changes to git git add results.txt to add files to your staging area git commit to save the changes to the local repository. Push changes to the server 11

Working on A0 Get a copy of the repository from the server Work on the assignment Save and commit your changes to git Push changes to the server git push to push to the remote repository. 12

Good Ideas Consider cloning via SSH or HTTPS. - For SSH, generate public/private keys. https://git.uwaterloo.ca/help/ssh/readme - If you use HTTPS, you might want to cache credentials https://git-scm.com/docs/git-credential-store Learn how to use tags or branches - See documentation 13

Gitignore Files to gitignore - Compiled and generated files - Sensitive information Creating a gitignore file doesn t remove files that were previously committed, so to to remove those files from git without deleting them from the filesystem you can use - git rm -r --cached. - git add. Useful, common gitignores - https://github.com/github/gitignore 14

Useful Commands git status - Displays the current files that have changed and files in the staging area. git diff - Shows file by file the changes you ve made git add -A - Adds all files to your staging area git commit -am Your message here - -a automatically adds all all modified files to your staging area - -m allows you to add a message on the command line rather than opening an editor 15

Tips Commit often Write detailed commit messages Group your commits into atomic functionality 16

Resources Git Home - documentation, binaries - https://git-scm.com Git Reference - cheat-sheet of commands - http://gitref.org Book: Pro Git - Scott Chacon and Ben Straub - extensive manual Ry s Git Tutorial - http://rypress.com/tutorials/git/index Git branching strategy - http://nvie.com/posts/a-successful-git-branching-model/ 17