2. Centralised Version Control System
• Server can be a bottleneck
• server goes down
• hard disk of central database
corrupted
• CVS, SVN
3. Distributed Version Control System
• Fully mirror the remote
repository
• Even server goes down,
clients still can work on local
repository
• Git
4. Git Workflow - Local
Modified Staged Committed
Working
Directory
Staging Area
.git/index
.git directory
ADD COMMIT
SOFT RESET
RESET
5. checkout vs reset
# remove modified changes
• git checkout -- filename
# revert file to a specific version
• git checkout HEAD -- filename
# undo a commit to unstaged status
• git reset HEAD~1
# reset a file to unstaged
• git reset HEAD~1 filename
# undo a commit to staged status
• git reset --soft HEAD~1
# undo a commit permanently
• git reset --hard HEAD~1