Introduction to �Version Control System
Kwanghoon Choi
Chonnam National University
1
Motivation
2
KalidAzadResumeOct2014.doc KalidAzadResumeMar2015.doc … | Instacalc-logo3.png Instacalc-logo4.png … |
time
Table of Contents
3
Version Control System (VCS)
4
General Actions in VCS: Checkin
5
(*) Trunk (in SVN), Branch (in Git) : The location for code in the repo.
(*) check in (in SVN), commit (in Git)
Checkout and editing
6
(*) Trunk (in SVN), Branch (in Git) : The location for code in the repo.
(*) check out (in SVN), fetch/pull (in Git)
Diffs
7
(*) Trunk (in SVN), Branch (in Git) : The location for code in the repo.
Branching
8
(*) Trunk (in SVN), Branch (in Git) : The location for code in the repo.
Merging
9
(*) Trunk (in SVN), Branch (in Git) : The location for code in the repo.
R8 has a merge of Bread from r7 Rice from r6.
Conflicts
10
(*) Trunk (in SVN), Branch (in Git) : The location for code in the repo.
1
1
2
3
4
5
Conflicts (cont.) : How to resolve?
11
(*) Trunk (in SVN), Branch (in Git) : The location for code in the repo.
Tagging
12
(*) Trunk (in SVN), Branch (in Git) : The location for code in the repo.
Real-Life Example
13
(*) Trunk (in SVN), Branch (in Git) : The location for code in the repo.
Two Main Types of VCS
14
Introduction to GIT
15
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local Computer
Remote Computer
Introduction to GIT: Workflow
16
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git clone
Introduction to GIT: Workflow
17
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git add
Introduction to GIT: Workflow
18
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git add
git commit
Introduction to GIT: Workflow
19
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git add
git commit
git commit –a
Introduction to GIT: Workflow
20
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git add
git commit
git commit –a
git push
Introduction to GIT: Workflow
21
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git add
git commit
git commit –a
git push
git fetch
Introduction to GIT: Workflow
22
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git add
git commit
git commit –a
git push
git fetch
git merge
Introduction to GIT: Workflow
23
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git add
git commit
git commit –a
git push
git fetch
git merge
git pull
Introduction to GIT: Workflow
24
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git add
git commit
git commit –a
git push
git fetch
git merge
git pull
git diff HEAD
Introduction to GIT: Workflow
25
Local
Repository
Remote
Repository
Index
(Stage)
Workspace
(Working
Directory)
Local
Computer
Remote
Computer
git add
git commit
git commit –a
git push
git fetch
git merge
git pull
git diff HEAD
git diff
Introduction to GIT: Workflow
26
My Repository
OSS Repository
pull request
fork
GitHub
27
fork
Pull request
[실습1]
28
순희.txt
철수.txt
kwanghoon/oss_git_example
순희.txt
soonnhee/oss_git_example
철수.txt
cheolsoo/oss_git_example
[실습2]
29
순희.txt
철수.txt
kwanghoon/oss_git_example
순희.txt
철수.txt
soonnhee/oss_git_example
순희.txt
철수.txt
cheolsoo/oss_git_example
GitHub Social Coding
$ git remote add pb https://github.com/kwanghoon/oss_git_example
$ git fetch pb
$ git diff pb/master ( cf. resolve conflicts if there are any )
$ git rebase pb/master
$ git commit -a -m “merge 3rd party contributions”
$ git push origin
30
Reference
31