git - an introduction

30
Git An Introduction K. ARVIND Overture Networks December 2013 DRAWS LIBERALLY FROM VARIOUS ONLINE RESOURCES, ESPECIALLY SCOTT CHACON’s EXCELLENT BOOK ON GIT

Upload: krishnamoorthy-arvind

Post on 25-Jul-2015

34 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Git - An Introduction

Git An Introduction

K. ARVIND Overture Networks

December 2013

DRAWS LIBERALLY FROM VARIOUS ONLINE RESOURCES, ESPECIALLY SCOTT CHACON’s EXCELLENT BOOK ON GIT

Page 2: Git - An Introduction

● What is Git?

● How is Git different?

● Giit conceptual overview

○ Hashes, Repository, Branching

Plan

Page 3: Git - An Introduction

• Distributed Version Control System

• Linux Community

• 2005

What is Git?

Page 4: Git - An Introduction

● Single server that contains versioned files

● Clients have version being worked on

● Easy to administer

● Single point of failure

● Need connectivity to commit

● Subversion, CVS, Perforce

Centralized VCS

Page 5: Git - An Introduction

Distributed VCS

● Every client has the full repository

● Central repository may also be used

● Local commits followed by push

● Fault Tolerant

● Work off-line

Page 6: Git - An Introduction

Why Git?

● Fast

● Simple

● Branching

● Fully distributed

● Scales well

Page 7: Git - An Introduction

No Deltas!

Page 8: Git - An Introduction

Dog ate cable - No problem!

Nearly every operation is local!

Page 9: Git - An Introduction

Name is a Digest

Git object name = SHA-1 hash of contents

Built-in integrity check

Page 10: Git - An Introduction

Cryptographic Digest

Page 11: Git - An Introduction

Commit Hash: Git Bash SOME PROPRIETARY INFORMATION REDACTED BELOW

Page 12: Git - An Introduction

Digest “uniqueness” is “real”! SOME PROPRIETARY INFORMATION REDACTED BELOW

Page 13: Git - An Introduction

Commit Hash - Gitk SOME PROPRIETARY INFORMATION REDACTED BELOW

Page 14: Git - An Introduction

Commit Hash: TortoiseGit SOME PROPRIETARY INFORMATION REDACTED BELOW

Page 15: Git - An Introduction

Git Objects

Page 16: Git - An Introduction

Commit History

Page 17: Git - An Introduction

Git Repository

Page 18: Git - An Introduction

Git Repository

Page 19: Git - An Introduction

Git repository

Page 20: Git - An Introduction

Branch - Pointer to a commit

● HEAD - points to current branch

● master - default branch

Page 21: Git - An Introduction

No branches added

Page 22: Git - An Introduction

Add a branch

gitbash> git branch testing f30ab

HEAD still points to master

Page 23: Git - An Introduction

Switch to branch

gitbash> git checkout testing

HEAD has moved to testing

Page 24: Git - An Introduction

Commit on branch

testing points to new commit

HEAD still points to testing

Page 25: Git - An Introduction

Switch back to master branch

gitbash> git checkout master

HEAD points to master now

Page 26: Git - An Introduction

Commit on master

Diverging branches - need to merge

later

Page 27: Git - An Introduction

Merge

gitbash> git merge iss53

Preferred alternative: git rebase

Page 28: Git - An Introduction

Pulling remote branches

Page 29: Git - An Introduction

Conclusion

● Conceptual overview

● Many key concepts

● Free resources available online for further

study:

● ProGit by Scott Chacon - http://git-scm.com/book

Page 30: Git - An Introduction

Thank you Scott Chacon!