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

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

Git Introduction CS 400. February 11, 2018

Git. Presenter: Haotao (Eric) Lai Contact:

CS 390 Software Engineering Lecture 5 More Git

Version Control: Gitting Started

VCS VERSION CONTROL SYSTEMS

Visualizing Git Workflows. A visual guide to 539 workflows

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

Git tutorial. Katie Osterried C2SM. October 22, 2015

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

Version Control Systems

Git for Newbies. ComMouse Dongyue Studio

Tizen/Artik IoT Practice Part 4 Open Source Development

Fundamentals of Git 1

Git for Subversion users

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:

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

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

AIS Grid School 2015

Version control with Git.

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

CSE 391 Lecture 9. Version control with Git

CS 390 Software Engineering Lecture 4 - Git

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

Beyond git add/commit/push

Laboratorio di Programmazione. Prof. Marco Bertini

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

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

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

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

Git, the magical version control

Improving Your Life With Git

Version Control with GIT

Software Development I

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

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

Git for Version Control

Submitting your Work using GIT

Git(Lab) Tutorial and Hands-On

Chapter 5. Version Control: Git

Github/Git Primer. Tyler Hague

Use git rm to remove files from workspace

Windows. Everywhere else

A BASIC UNDERSTANDING OF VERSION CONTROL

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

Being More Productive with Git

Revision control Advanced git

I m an egotistical bastard, and I name all my projects after myself. First Linux, now git. Linus Torvalds, creator of Linux and Git

Git Tutorial. André Sailer. ILD Technical Meeting April 24, 2017 CERN-EP-LCD. ILD Technical Meeting, Apr 24, 2017 A. Sailer: Git Tutorial 1/36

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

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

FAQ Q: Where/in which branch do I create new code/modify existing code? A: Q: How do I commit new changes? A:

Review Version Control Concepts

Version Control Systems. Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University

Software Project (Lecture 4): Git & Github

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

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

Introduction, Instructions and Conventions

Computer Science Design I Version Control with Git

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

Version Control System GIT

Lecture 6 Remotes. Sign in on the attendance sheet!

b. Developing multiple versions of a software project in parallel

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

Revision Control. An Introduction Using Git 1/15

Introduction to Git and Github

Git. Ľubomír Prda. IT4Innovations.

Git version control with Eclipse (EGit) Tutorial

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

From Commits to Collaboration: A Git Tutorial for Social Scientists

Algorithm Engineering

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

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

Lab session 1 Git & Github

Creating a Patch. Created by Carl Heymann on 2010 Sep 14 1

Introduction to Version Control with Git

git-flow Documentation

Git Workbook. Self-Study Guide to Git. Lorna Mitchell. This book is for sale at

Git for (not-so) dummies

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

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

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

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

Basics of Git GitHub

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

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

The Rock branching strategy is based on the Git Branching Model documented by Vincent Driessen.

Git, The Developers Perspec ve

GIT for companies Mark Struberg, INSO TU Vienna

Version Control with GIT: an introduction

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

Introduction to GIT. Jordi Blasco 14 Oct 2011

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

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

Using Git to Manage Source RTL

CS 320 Introduction to Software Engineering Spring February 06, 2017

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

Lecture 4 More on Commits and Branches

RSARTE Git Integration

Transcription:

About SJTUG SJTU *nix User Group SJTU Joyful Techie User Group Homepage - https://sjtug.org/ SJTUG Mirrors - https://mirrors.sjtug.sjtu.edu.cn/ GitHub - https://github.com/sjtug

Git Basic Tutorial Zhou Fan (@Evensgn), SJTUG i@evensgn.com

What is Git Git is a free and open source distributed version control system Then what is GitHub/GitLab/BitBucket?

History of Git Maintenance of Linux kernel project 1991 2002 patches and archived files 2002 2005 BitKeeper (was not open-source) 2005 BitKeeper s free-of-charge status was revoked Linus developed Git

Why Git Great branching model Distributed Small & Fast

Get Started! Suppose we need to develop a project, say a program to calculate A + B Fix bugs / Add new features Collaborating with others We have Git installed https://git-scm.com/book/en/v2/getting-started-installing-git

Getting a Git Repository Turn a local directory into a git repository git init Clone a remote git repository git clone

Staging Area Make Some Changes Change 1 Change 2 Change 3 Last Commit Working Directory Staging Area.git Directory

Staging Area Add Change 1 git add Change 2 Change 3 Last Commit Working Directory Staging Area.git Directory

Staging Area

Staging changes git status Check the status of the working directory git add git add <file> Stage change of <file> so that it would be included in the next commit

Commit changes git commit Confirm changes in the staging area Make a snapshot of the working directory (ignore changes not added)

Commit changes You may have to tell git who you are at the first time

git log

git reset Reset current HEAD to the specified commit git reset soft <commit>: leaves all your changed files "Changes to be committed" git reset hard <commit> discard any changes to tracked files since <commit> Commit Commit Commit Commit Commit HEAD

git reset Reset current HEAD to the specified commit git reset soft <commit>: leaves all your changed files "Changes to be committed" git reset hard <commit> discard any changes to tracked files since <commit> Commit Commit Commit Commit Commit HEAD

Undoing things Unstaging a staged file git rest HEAD <file>

Undoing things Unmodifying a modified file git checkout -- <file>

Remote repositories git remote add Add a remote repository to be tracked

git pull git pull <repository> <branch> Incorporates changes from a remote repository into the current branch

git pull git pull <repository> <branch> Incorporates changes from a remote repository into the current branch

Collaborate with others

git push git push <repository> <branch> Push local changes the remote repository

Oops! Merge conflicts

Resolving merge conflicts

Branching git branch <new branch> Create a new branch git checkout <branch> Switch to <branch> git branch d <branch> Delete <branch>

git stash Stash the changes in a dirty working directory away git stash git stash list git stash apply git stash clear

git merge git merge <branch> Merge <branch> into the current branch

git merge git merge <branch> Merge <branch> into the current branch A simple case

git merge git merge <branch> Merge <branch> into the current branch A simple case fast-forward merge

git merge git merge <branch> Merge <branch> into the current branch A not-that-simple case (There may be merge conflicts)

git merge git merge <branch> Merge <branch> into the current branch A not-that-simple case

Git workflow

git rebase Review: branch merging

git rebase Another way to do that: replay changes of experiment to master git checkout experiment git rebase master Or: git rebase master experiment

git rebase With merging

git rebase Fast-forward merge git checkout master git merge experiment

git rebase More complex rebasing

git rebase More complex rebasing git rebase onto master server client

git rebase More complex rebasing git checkout master git merge client (Fast-forward merge)

git rebase More complex rebasing git rebase master server

git rebase More complex rebasing git checkout master git merge server (Fast-forward merge)

git rebase A way to clean up your story rebase local changes you ve made before you share them then you push them

Reference Git Reference - https://git-scm.com/docs Pro Git Book - https://git-scm.com/book/en/v2

Thanks