git tutorial for cs320 students

11
GIT Tutorial Ozyegin University, Computer Science CS 320 - Software Engineering [email protected] October 14, 2014 (CS 320- Software Engineering) GIT Tutorial October 14, 2014 1 / 11

Upload: muratkrty

Post on 29-Jun-2015

1.391 views

Category:

Engineering


1 download

DESCRIPTION

Software Engineering lecture slide

TRANSCRIPT

Page 1: Git tutorial for CS320 Students

GIT Tutorial

Ozyegin University, Computer ScienceCS 320 - Software Engineering

[email protected]

October 14, 2014

(CS 320- Software Engineering) GIT Tutorial October 14, 2014 1 / 11

Page 2: Git tutorial for CS320 Students

History and Basics

GIT is

1 fast (thanks to C)

2 distributed (unlike SVN)

3 secure (check SHA)

4 intuitive and easy to learn

5 FOSS (GPLv2)

6 used by pros (DHH, Torvalds)

7 used for reputable projects (Rails,Django, Linux kernel)

(CS 320- Software Engineering) GIT Tutorial October 14, 2014 2 / 11

Page 3: Git tutorial for CS320 Students

Use the GIT, young Padawan!

A 7−→ GITB 7−→ SVN

1

1google,trends(CS 320- Software Engineering) GIT Tutorial October 14, 2014 3 / 11

Page 4: Git tutorial for CS320 Students

Work Flow I

2

2http://git-scm.com/book/en/Getting-Started-Git-Basics(CS 320- Software Engineering) GIT Tutorial October 14, 2014 4 / 11

Page 5: Git tutorial for CS320 Students

Work Flow II

3

3http://blogpro.toutantic.net/2012/01/02/another-git-branching-model/(CS 320- Software Engineering) GIT Tutorial October 14, 2014 5 / 11

Page 6: Git tutorial for CS320 Students

Setup/Configuration

Who the heck are you?

$ git config –global user.name=luke$ git config –global [email protected]$ git config –global core.editor emacs$ git config –global color.iu true

(CS 320- Software Engineering) GIT Tutorial October 14, 2014 6 / 11

Page 7: Git tutorial for CS320 Students

Setup/Configuration

Command-FU

$ mkdir demo; cd demo; emacs demo.rb & # print “hello”/demo$ git add ./demo$ git commit -m “Added demo.rb”/demo$ git log/demo$ git lg # aliased and beautified log version

Play with your first repo via CRUD operations.

Command-FU II

/demo$ git reflog/demo$ git diff/demo$ git diff –cached/demo$ git clone

(CS 320- Software Engineering) GIT Tutorial October 14, 2014 7 / 11

Page 8: Git tutorial for CS320 Students

Command-Fu III

Most used commands. API approach is OK!

$ git init$ git clone$ git add$ git status$ git commit$ git branch$ git checkout$ git merge$ git push$ git fetch$ git pull$ git log$ git revert

(CS 320- Software Engineering) GIT Tutorial October 14, 2014 8 / 11

Page 9: Git tutorial for CS320 Students

Do or Do not!

DO

1 CRUD commit messages

2 commit often

3 use aliased commands

4 ask help!!

5 ...

DO NOT!

1 commit with errors

2 use personal work-flow

3 work in single branch

4 RY

5 ...

(CS 320- Software Engineering) GIT Tutorial October 14, 2014 9 / 11

Page 10: Git tutorial for CS320 Students

Worth to read/watch

Videos

Introduction to Git with Scott Chacon of GitHub

Tech Talk: Linus Torvalds on git

Git From the Bits Up (Advanced)

Advanced Git: Graphs, Hashes, and Compression, Oh My!

Tutorials

Git and GitHub Version Control Tutorial

Atlassian Git Tutorials

Pro Git Book (Freely available)

Try Git/Github

What are other good resources for learning Git and GitHub?

git –help

(CS 320- Software Engineering) GIT Tutorial October 14, 2014 10 / 11

Page 11: Git tutorial for CS320 Students

Tips/Tricks

4

4http://blog.codinghorror.com/learn-to-read-the-source-luke/(CS 320- Software Engineering) GIT Tutorial October 14, 2014 11 / 11