Short introduction about vcs & git usage.
Aimed to introduce concept of version control system and git to people who didn't used git or vcs yet. Doesn't introduce deep part of git or operating policy for git. Just focus on simple introduction about main functionality and abstracted internal design.
11. git
Distributed Version Control System
Developed For Kernel SCM By Linus Torvalds
“Only wimps use tape backup: real men just upload their important stuff on ftp,
and let the rest of the world mirror it ;)” - Linus Torvalds
Just Remember: Cool Programmer Uses GIT
12. GIT, ALONE AND FREE
“Yes, I’m Alone, But I’m Alone And Free”
- Frozen -
13. git init: Create Repository
$ mkdir olaf && cd olaf && git init
`pwd` Is Now A Git Repository
Can Version Control Files Inside `pwd` Now
14. git add: Add Files Under Git’s Admin
$ echo “warmhug” > favor && git add favor
They Will Be One Of Version Later
15. git status: Show Git’s Admin Status
$ git status
$ echo “anna” >> favor
$ git status
Changed? Deleted? Be Conflicted?
16. git commit: Make Version
$ git commit -m “add warmhug as favor”
Already Added Files Are New Version, Now
17. git log: Show History
● Development Cycle
○ While(!blamed) {Analysis(); Develop(); Blame();}
Useful For Blaming ;)
19. git checkout: Move To Other Branch
git
git
git
git
git
git
checkout more_favor
branch
commit -am “add anna as favor, too”
log
checkout master
log
20. git checkout: Move To Commit
$ git checkout d8ec26
Branch Is Just Name Of Ref To Commit
21. Life Of Files Under Git, Internal
FileA ver 0
FileB ver 0
22. Life Of Files Under Git, Internal
git commit
commit 1
FileA ver 0
FileB ver 0
23. Life Of Files Under Git, Internal
HEAD
git branch
commit 1
FileA ver 0
FileB ver 0
master
branch
24. Life Of Files Under Git, Internal
HEAD
FileB Changed
master
branch
commit 1
FileA ver 0
FileB ver 0
FileB ver 1
25. Life Of Files Under Git, Internal
HEAD
git commit -a
commit 1
FileA ver 0
FileB ver 0
master
branch
commit 2
FileB ver 1
26. Life Of Files Under Git, Internal
HEAD
git commit -a
commit 1
FileA ver 0
FileB ver 0
master
branch
commit 2
FileB ver 1
27. Life Of Files Under Git, Internal
HEAD
Change FileA, FileB
git commit -a
commit 1
FileA ver 0
FileB ver 0
commit 2
FileB ver 1
master
branch
commit 3
FileA ver 1
FileB ver 2
28. Life Of Files Under Git, Internal
HEAD
git checkout -b newbranch
commit 1
FileA ver 0
FileB ver 0
commit 2
FileB ver 1
master
branch
newbranch
commit 3
FileA ver 1
FileB ver 2
29. Life Of Files Under Git, Internal
HEAD
Change FileA
git commit -a
commit 1
FileA ver 0
FileB ver 0
master
branch
commit 2
FileB ver 1
newbranch
commit 3
commit 4
FileA ver 1
FileB ver 2
FileA ver 2
30. GIT IS AN OPEN DOOR
“We Can Fix This Hand In Hand”
- Frozen -
36. git pull: Fetch & Merge Changes
May Cause Conflict In Some Scenario
Remember To Make Things Clean Before Push
37. Free GIT Repo Hosting Service
● GitHub
○ Popular Service
○ Money For Private Repository
● Bitbucket
○ Less Than GitHub, But Popular
○ No Money For Private Repository