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

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

Git Introduction CS 400. February 11, 2018

Git. Presenter: Haotao (Eric) Lai Contact:

CS 390 Software Engineering Lecture 5 More Git

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

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

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

Computer Science Design I Version Control with Git

Git tutorial. Katie Osterried C2SM. October 22, 2015

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

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

CS 390 Software Engineering Lecture 4 - Git

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 with Git.

A BASIC UNDERSTANDING OF VERSION CONTROL

Lecture 6 Remotes. Sign in on the attendance sheet!

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

Version Control. Version Control

Version Control: Gitting Started

AIS Grid School 2015

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

Software Development I

MOOSE-Based Application Development on GitLab

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

Outline. Version Control System (VCS) basics Git terminology & concepts Basic Git commands Branches in Git Git over the network (time permitting)

Git for Version Control

Git & Github Fundamental by Rajesh Kumar.

Visualizing Git Workflows. A visual guide to 539 workflows

Configuring Git. Matthieu Moy. configuring-git-slides.

Version Control. Version Control

Intermediate Programming, Spring Misha Kazhdan

Github/Git Primer. Tyler Hague

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

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

Revision control. INF5750/ Lecture 2 (Part I)

Midterm Next Week. Last year s midterm (which didn t include remotes):

Managing Network Configurations with Git and GitLab

VCS VERSION CONTROL SYSTEMS

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

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

Tutorial 2 GitHub Tutorial

Software Revision Control for MASS. Git Basics, Best Practices

Introduction to Version Control with Git

Introduction to Git and Github

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

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

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

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

Chapter 5. Version Control: Git

Tizen/Artik IoT Practice Part 4 Open Source Development

Version Control with Git

Git for Newbies. ComMouse Dongyue Studio

Git. Ľubomír Prda. IT4Innovations.

Gitting things done. Hands-on introduction to git niceties. Jan Urbański Ducksboard

Using GitHub and SourceTree to work with DITA TC repositories

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

Git for Subversion users

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

Version Control System - Git. zswu

CS314 Software Engineering Configuration Management

Git(Lab) Tutorial and Hands-On

DEVNET Introduction to Git. Ashley Roach Principal Engineer Evangelist

Revision Control. An Introduction Using Git 1/15

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

Lecture 3: Processing Language Data, Git/GitHub. LING 1340/2340: Data Science for Linguists Na-Rae Han

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

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

FEEG Applied Programming 3 - Version Control and Git II

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

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

Source Code Management wih git

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

L Modeling and Simulating Social Systems with MATLAB

Using GitHub to Share with SparkFun a

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

Git: Distributed Version Control

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

Algorithm Engineering

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

Git: Distributed Version Control

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

Distributed Version Control (with Git)

Beyond git add/commit/push

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

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

Object Oriented Programming. Week 1 Part 2 Git and egit

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Laboratorio di Programmazione. Prof. Marco Bertini

A Brief Git Primer for CS 350


Review Version Control Concepts

Version control system (VCS)

Barry Grant

A Practical Introduction to git

CSE 391 Lecture 9. Version control with Git

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

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

Git, the magical version control

Revision control Advanced git

Improving Your Life With Git

Transcription:

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

Outline Version control system Git basics Git branch Remote repository 2

Outline Version control system Git basics Git branch Remote repository 3

What is Version Control? 4

Version Control System Store the projects, keep your revision history Synchronization between modifications made by different developers 5

Students VCS 6

How to work with others??? 7

Dropbox VCS in Reality 8

Outline Version control system Git basics Git branch Remote repository 9

Git Git is a version control system which is Fast Easy to use Distributed Able to handle large project (ex. Linux Kernel) A git repository is a mini database that tracks your files 10

Installation Please check this link http://git-scm.com/book/en/getting-started- Installing-Git 11

Configuration Modify ~/.gitconfig Or, type in following commands git config --global user.name your name git config --global user.email your@email.com For more information, please refer this link 12

Creating a new Repository Two ways to create a repository Initializing a Repository in an Existing Directory git init Cloning an Existing Repository We will talk about it later The repository information will be stored in the.git directory 13

Committing A Version Modifying Files Staging Modified Files (Add) Committing A Version 14

Committing A Version Staging (adding) a file git add [file name] Staging all files in the current directory git add -A Committing git commit -m [message] 15

Status Checking the current status and the current branch git status 16

A History Tree 13CD8E HEAD HEAD is a pointer pointing to the version you are looking at now 95165E 91DCA1 The versions you committed form a history tree B259F1 A9D013 17

Logs Listing the log git log Listing each log in one line git log --oneline 18

Checking Out A Version HEAD 13CD8E 95165E 91DCA1 git checkout 91DCA1 B259F1 A9D013 19

Outline Version control system Git basics Git branch Remote repository 20

Branches Master Branching Merging Develop Optimization A New Menu 21

The Master Branch HEAD Master 13CD8E A branch in Git is actually a label pointing to a version Master branch is the default branch created at the start time 95165E 91DCA1 B259F1 A9D013 22

Branching HEAD Master 13CD8E Feature 95165E HEAD 91DCA1 23

Branching 34F19D Master 13CD8E Feature 95165E HEAD 91DCA1 24

Branching 34F19D Feature Master 13CD8E HEAD 95165E 91DCA1 25

Branching 34F19D Feature Master 13CD8E HEAD 95165E 91DCA1 26

Branching 1F9D18 34F19D Feature Master 13CD8E HEAD 95165E 91DCA1 27

Git Branching Creating a new branch (label) git branch [branch name] Checking out the branch (move the HEAD) git checkout [branch name] Combining the above commands (create & checkout) git checkout -b [branch name] 28

Merging 3827FA 84091E Feature Master 1F9D18 34F19D HEAD 13CD8E 29

Git Merging Merging Steps Checking out a branch to merge git checkout [branch 1 name] Merging another branch git merge [branch 2 name] 30

Outline Version control system Git basics Git branch Remote repository 31

Collaboration with Git To work with others using git, you ll need a server that store the repository. Git is distributed, which means Everyone can store a copy of the repository downloaded from the server They can do their jobs independently 32

Collaboration workflow Server Clone Clone Local A 33 Local B

Collaboration workflow Server Commit New Local A 34 Local B

Collaboration workflow Server Push New Local A 35 Local B

Collaboration workflow New Server Push Pull New Local A 36 Local B

Cloning & Pushing Cloning the remote repositories git clone [Remote URL] The [Remote URL] is saved as Origin After committing a few versions, you can push the branch back to Origin git push -u origin [Branch Name] 37

Fetch & Pull Updating a branch from the remote repository Fetching the remote repository to local git fetch origin Merging the remote branch git merge origin/[branch Name] Doing above commands in one command git pull [Branch Name] 38

Fork 3827FA 84091E 1F9D18 34F19D 13CD8E The Repo. Under TA s Account 39

Fork 3827FA 3827FA 84091E 84091E 1F9D18 34F19D 1F9D18 34F19D 13CD8E 13CD8E The Repo. Under TA s Account The Repo. Under Your Account 40

Pull (Merge) Request 528A03 3827FA Pull Request 528A03 3827FA 84091E Accept 84091E 1F9D18 34F19D 1F9D18 34F19D 13CD8E 13CD8E The Repo. Under TA s Account The Repo. Under Your Account 41

.gitignore File You can ignore some files that you don t want them to be tracked by editing the.gitignore file Remember to track and commit your.gitignore file Don t know what should be in.gitignore? https://github.com/github/gitignore https://www.gitignore.io/ 42

43

Reference Learn Git branching (interactive) http://pcottle.github.io/learngitbranching/ Pro Git http://git-scm.com/book/ 寫給 大家的 Git 教學 http://www.slideshare.net/littlebtc/git-5528339 44