git tutorial for cs320 students
DESCRIPTION
Software Engineering lecture slideTRANSCRIPT
GIT Tutorial
Ozyegin University, Computer ScienceCS 320 - Software Engineering
October 14, 2014
(CS 320- Software Engineering) GIT Tutorial October 14, 2014 1 / 11
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
Use the GIT, young Padawan!
A 7−→ GITB 7−→ SVN
1
1google,trends(CS 320- Software Engineering) GIT Tutorial October 14, 2014 3 / 11
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
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
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
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
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
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
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
Tips/Tricks
4
4http://blog.codinghorror.com/learn-to-read-the-source-luke/(CS 320- Software Engineering) GIT Tutorial October 14, 2014 11 / 11