32
November 18, 2012 Source Code Management with Git & Github.com Kiattisak Anoochitarom

Git slide

Embed Size (px)

DESCRIPTION

Source Code Management with Git and Github. Nov 18, 2012. Department of Computing, Silpakorn University.

Citation preview

Page 1: Git slide

November 18, 2012

Source Code Management with Git & Github.comKiattisak Anoochitarom

Page 2: Git slide

Introduction to VCS

What is version control, and why should care ? Version Control is a system that record changes to a file or set of files over time so that you can recall a specific versions later. For the example in this class you will use software source code as the files being version controlled, through in reality you can do this with nearly any type of file on a computer.

It allows you to revert files back to a previous state, revert the entire project back to a previous state, compare changes over time, see who last modified something that might be causing a problem, who introduced an issue and when, and more.

Page 3: Git slide

Local Version Control

Page 4: Git slide

Centralized Version Control

Page 5: Git slide

Centralized Version Control

Page 6: Git slide

Distributed Version Control

Full Mirror

Almost Everything is Local

Fast

Full Backup

Work Offline

Page 7: Git slide

Version Control System Software

SVN (Subversion)Mercurial (HG)

Page 8: Git slide

Git

Page 9: Git slide

FastSimpleMany branchesFully Distributed

Work efficiently with Linux Kernel

Page 10: Git slide

Who use git ?

Page 11: Git slide
Page 12: Git slide

3 File Status on Git

untracked unmodified modified staged

edit the file

stage the file

commit the file

add the file

remove the file

Page 13: Git slide

3 Stages of Git

The Basic Git workflow

1. You modify files in your working directory.2. You stage the files.3. You do a commit, files on your staging area are permanently stores in Repository.

working directory

staging area

git directory (repository)

checkout the project

stage files

commit files

Page 14: Git slide

Download and Install Git

http://www.git-scm.com

Page 15: Git slide

Basic Configuration

$ git config --global user.name “iMacbaszii” ***

$ git config --global user.email “[email protected]” ***

$ git config --global core.editor mate

$ git config --global merge.tool vimdiff

$ git config --list ***

$ git config user.name ***

Page 16: Git slide

Create Repository

Page 17: Git slide

Stage and Commit File

Page 18: Git slide

Check your files status

Page 19: Git slide

Log Committed History

Page 20: Git slide

Remove, Rename File

Page 21: Git slide

Demo

Page 22: Git slide

Github.com

Page 23: Git slide

Generating SSH Keys (public key)

https://help.github.com/articles/generating-ssh-keys

$ ssh-keygen -t rsa -C “[email protected]

Page 24: Git slide

Add your SSH key to Github

https://help.github.com/articles/generating-ssh-keys

Page 25: Git slide

Create online Repository

Page 26: Git slide

Quick setup

Page 27: Git slide

Work with Github

Page 28: Git slide

It’s work.

Page 29: Git slide

Clone Repository

Page 30: Git slide

Many Open-Source Library on Github

Page 31: Git slide

GUI Tools

http://code.google.com/p/tortoisegit/http://www.sourcetreeapp.com

Tortoise GitSourceTree

Page 32: Git slide

Book Recommended

https://github.com/opendream/progithttp://www.progit.org