際際滷

際際滷Share a Scribd company logo
Geun-Hyung Kim
UMCL @ Dong-Eui University
Introduction to
Git/GitHub
覯 蟯襴 ろ
Local Version Control / Central Version Control / Distributed Version Control
Git - Basic
Git - Tutorial : Just doing small work with Git
Configuration
Create Repository
Git Workflow
GitHub - Tutorial: Just doing small work with remote storage
Create/Delete Repository
Create branch
Open Pull Request /Merge Pull Request
覈 谿
願  伎
Version Control System
What is Version Control?
A category of software tools that help a software team manage
changes to source code over time.
(語 螳覦  螳覦 譴 れ 覲蟆 蟯襴襯  
 蟲)
覯 蟯襴 ろ
覈  覲襯 螳 磯 覯 蟯襴 一危磯伎れ 蠍磯  譴 轟
 覯 れ 蟶朱伎   ろ
蠏碁 企  企 覯 蟯襴 ろ(VCS - Version Control System)  螳
VCS襦 企語 伎 覯(覲蟆 企 轟  伎) 蟯襴 蟆 覈
螳 殊 伎 襦 襴  
襦 豌企ゼ 伎 襦   
螳 磯  伎 觜蟲 覲  
螳 覓語襯 殊殊式讌 豢
VCS襯 覃  蟇磯 覈   所 覲糾規
Benefits (レ)
A complete long-term change history of every file
 , , 覲蟆所骸 螳  覲蟆曙  豌 ろ襴襯 蠍磯螻  螻手碓  覯 伎
螳
Branching and merging
branch(觚豺)  蠍磯レ 伎   螳覦 
螳 螳覦れ 螳 觚豺  襦 豢 覦讌 蟆讀
 蟆郁骸襯 牛 豕譬 螳覦 覦壱 覯 蟆一
Traceability
螳 覲蟆曙  覈螻 襯 る 譯殊   襦   覲蟆曙  豢 螳
Version Control System
What can we do with VCS?
螳 襦貉 一危磯伎るゼ  殊 覲蟆 覲企ゼ 蟯襴
RCS (Revision Control System): 殊 覲蟆暑 覿覿 (Patch Set) 
覲  朱 ロ 殊 轟 朱 襴  
Version Control System
Local Version Control
Check-in
Check-out
<source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics>
るジ 螳覦 蟷  覃   覯 蟯襴襯  ろ語 覯襯 伎 覦
覯 (: CVS, Subversion, Perforce 螳 ろ )
レ: 襦語 谿語 螳覦 螳 覓伎 螻 讌 蟯襴 ,  VCS襦 蟯襴 螳
: 譴 覯螳 覓語螳 覦覃 覦煙  覦覯 
Version Control System
Centralized VCS (CVCS)
<source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics>
Check-in (Commit)
Check-out
Check-in (Commit)
Check-out
Version Control System
Distributed VCS (DVCS)
レ 豌企ゼ 襦貉 語ろ碁 覲旧   覃 覯 蟯襴襯 ,
   ろ語 覯襯 伎
Check-in
(Commit)
Check-out
pull
(clone) push
レ:
ろ語 覯 レ螳 覦
 螳覲 螳覦  襦貉 貉
一 讌 螳
れ  襦 螳
:
覦企襴 一危磯ゼ ロ 
 蟆曙  螻糾 襷 谿讌
ろ襴螳 襷 蟆曙 れ企
螻 襦 襷 螳 
: Git, Mecurial, Bazaar 
<source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics>
Git - Basic
Developed as the version control system for Linux Kernel
Project (襴 貉る 襦碁ゼ  覯 蟯襴 ろ朱 螳覦)
Birth year: 2005
Initial purpose (豐蠍 覈)
speed (觜襯 )
simple design ( 蟲譟)
strong support for non-linear development (thousands of parallel branches)
( る 觚豺襯 牛 觜 螳覦)
fully distributed (覯渚 覿)
capable of handling large projects efficiently
(襴 貉る 螳  襦  讌)
Git
History
Linus Torvards
Git thinks about its data more like a stream of snapshots. (Git 一危磯ゼ る結
 ろ碁殊朱 螻)
Every time you commit, or save the state of your project in Git, it basically takes a
picture of what all your files look like at that moment and stores a reference to that
snapshot. (一危磯ゼ 螳語り碓 襦碁ゼ ロ 襷 蠏  殊 伎 る
血 蟲  蠏 蟆 朱一るゼ )
To be efficient, if files have not changed, Git doesnt store the file again, just a link
to the previous identical file it has already stored. (覲蟆暑讌  殊 れ 殊
ロ讌 螻 伎  狩 殊 襷)
Git
Basic: snapshot
<source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics>
Everything is check-summed before it is stored and then is referred to by
that checksum (一危磯ゼ ロ蠍  豌危 蟲覃  豌危 牛 一
磯ゼ 蟯襴)
Git uses a SHA-1 hash for this checksumming (豌危 螻一 SHA-1 伎 
)
40-character string composed of hexadecimal characters (16讌 覓語 (0, 1,.., 9, a,b,.,,f)襦 蟲
焔 40螳 覓語)
calculated based on the contents of a file or directory structure (殊 伎  襴 蟲
譟磯ゼ 蠍磯朱 螻)
Git stores everything in its database not by file name but by the hash value
of its contents (一危磯伎れ  企   貊豸 伎 螳 )
Git
Basic: checksum
hash value example
Three main sections(瑚 )
Working directory ( 螻糾): a single checkout of one version of the
project (襦語 轟 覯 朱る レ 豢 殊 螳語 
  レ)
Staging Area (讌蟆一): a file, generally contained in your repository, that
stores information about what will go into your next commit (れ 貉る
蟆 伎 覲企ゼ ロ螻   - 朱朱 レ )
Repository (レ): stores the metadata and object database for your
project (襦語 覃一危一 螳豌 一危磯伎るゼ ロ 螻)
Git
Basic: three sections / states
checkout
Working
Directory
Staging
Area
Repository
add commit
Git has three main states that your files can reside in (Git 殊 
螳讌 襦 蟯襴)
Committed: the data is safely stored in your local database (一危郁 レ 蟆
ル )
Staged: you have marked a modified file in its current version to go into your next
commit snapshot ( 覯  殊 れ 覯 ロ蠍   )
Modified: you have changed the file but have not committed it to your database yet
(殊  朱 讌 レ レ ル讌  )
Git
Basic: three sections / states
(committed state)
(staged state)(modified state)
<source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics>
1. modify files in your working directory ( 襴 殊
)
2. stage the files, adding snapshots of them to your staging area
(staging  殊 る血 燕 豢螳)
3. do a commit (staging  殊 レ )
Git
Basic: Simple Workflow
Just go to http://git-scm.com/download/win (automatic download)
Git
Install Git for Windows
go to https://git-for-windows.github.io/
Git
Install Git for Windows
Git Bash
Git GUI
Shell Integration
Just doing small work
with Git
Configuration
Git Work flow
Create Repository
Git - Tutorial
Configuration
Git れ  蟆曙 れ覃 譴 Git   覦
Git 蠏碁企  れ 伎 讌
git 企 覈轟
$ git config  伎伎 れ 伎   覲蟆
蟯 れ 
/etc/gitconfig : ろ 覈  覈 レ  れ
$ git config --system 旧朱  殊 
~/.gitconfig, ~/.config/git/config : 轟 蟆襷  れ
$ git config --global 旧朱  殊 
.git/config : Git 襴 螻 轟 レ(轟   譴 襦)襷 
$ git config --local 旧朱  殊 
 : 襦 ->  -> ろ 朱 
Windows  $HOME 襴 (襷 C:Users$USER 襴) .gitconfig
Git - Tutorial
Configuration
$ git config user.name Geun-Hyung Kim
$ git config user.email geunkimkorea@gmail.com
$ git help config
config (git 企 覈轟)   る 豌
$ git config user.name Geun-Hyung Kim
$ git config user.email geunkimkorea@gmail.com
$ git help config
config (git 企 覈轟)   る 豌
Git - Tutorial
Create Repository
$git init:
 襴襯 誤 覈轟
gitstore朱 襦 襴襯
燕 覈轟
gitstore 襴襦 企
 襴螳 geunkim 覦 gitstore 襴 
 襴 伎 誤 覈轟
git レ (.git  襴 )
襯 豐蠍壱 覈轟
~/gitstore/.git レ襯 豐蠍壱
git metadata襯 ロ 襴
.git 襴襯 襷り レ 蟯 metadata襯 .  .git 襴螳 
working directory git 覈轟企ゼ ろ    
Q) るジ 襦語 谿語蟇磯 Git レ襯 覲旧 り 苦  ?
Windows  cd襯
Git - Tutorial
Working Directory 
working directory    
$ git status:working directory repository 襯 豌危, 企 殊 working directory
 讌, commit  覲蟆曙 讌 煙 
working directory tracked untracked襦 
untracked file  讌 git 蟯襴   
tracked file git 伎 蟯襴  (企 レ staging area  )
create README.txt file
add the file to staging area
commit changes
modified README.txt and create new LICENSE
add both files to stage area
commit changes
Git - Tutorial
Git Workflow
Git - Tutorial
Git Workflow: create README.txt
vi ク讌蠍磯ゼ 伎
README.txt  
 襴 伎 
豕蠏 commit 危襦 覲蟆曙 
蟯襴讌  覈襦
commit蠍  豢螳 蟆 朱 untracked file 譟伎
襦蟆 焔
Git - Tutorial
Git Workflow: add file to staging area
README.txt 殊
staging area add
commit   覈襦
staging area
Git - Tutorial
Git Workflow: commit changes
staging area 殊 レ 
 殊 伎 覓伎 讌
螳comment 伎version control master
staging area working directory
Git - Tutorial
Git Workflow: modifies README.txt adds LICENSE
README.txt  
LICENSE  襦蟆 
master branch 
tracked file 譴   
untracked file
Git - Tutorial
Git Workflow: add files to staging area
 /  覈 豢螳
$ git add README.txt LICENSE
Git - Tutorial
Git Workflow: commit changes
Git - Tutorial
Git TimeLine History
$git log: レ commit ろ襴襯 螳 朱 覲伎譴,
螳 豕蠏殊 commit 蟆 螳 襾殊 豢
master
To discard changes in working directory [working directory
 覲蟆 伎 覓伎() る
Git - Tutorial
check out
$ git checkout -- <fileName>
Git - TutorialWeb Programming - Workflow
4 螳 殊 燕  git status  蟆郁骸 覃
4 螳 殊 staging area襦 豢螳 蟆郁骸
Git - TutorialWeb Programming - Workflow
4 螳 殊 repository 螳 
repository  豌危
Just doing small work with
Remote Storage
(GitHub)
What is GitHub ?
Create a Repository
Create a Branch
Make and Commit Changes
Open a Pull Request
Merge a Pull Request
GitHub - Tutorial
< source: https://guides.github.com/activities/hello-world/ >
a code hosting platform for version control and collaboration
(覯 蟯襴   (code) 語ろ )
It lets you and others work together on project from anywhere
(企 襦語  螳ロ襦 )
GitHub - Tutorial
What is GitHub?
master
GitHub
(Remte Repository)
push
pull
pull
< source: https://guides.github.com/activities/hello-world/ >
1. るジ讓  + 覃企ゼ   New repository 襯 
2. レ 企 hello-world 襦 .
3. 讌ъ る 
4. Initialize this repository with a README 襯 
5. Create repository襯 企Ν
GitHub - Tutorial
Create Repository
repository 煙 覃
< source: https://guides.github.com/activities/hello-world/ >
GitHub - Tutorial
Create Repository
< source: https://guides.github.com/activities/hello-world/ >
1. る レ襯 
2. (れ)  
3. 覃伎   覯殊 企Ν
4.  レ 企   
GitHub - Tutorial
Delete Repository
GitHub - Tutorial
Create a Branch
Branching: レ るジ 覯   覦覯
蠍磯蓋朱 レ 豕譬 覯(豕譬 branch) master朱  branch襯 螳讌
master commit蠍  ろ碁ゼ 蠍   branch襯 
master branch襯 燕覃 蠏  master 覲旧  る血 
master branch
Create feature branch from master Merge feature branch into master
Commit changes Submit Pull Request Discuss proposed changes
< source: https://guides.github.com/activities/hello-world/ >
1. 襦 hello-world レ襯 
2. branch: master 朱  覈襦  drop down 企Ν
3. 襦 branch text box branch 企 readme-edits襦 
4.  Creat branch box襯 螻 return  
GitHub - Tutorial
Create a Branch
< source: https://guides.github.com/activities/hello-world/ >
GitHub - Tutorial
Create a Branch
branch 覈襦
 branch
譯 branch
readme-edit branch  README.md 殊 企Ν
   file view るジ讓  壱 icon 企Ν
editor 伎 
覲蟆 伎 る commit message襯 
Commit changes 覯殊 企Ν
GitHub - Tutorial
Make and commit changes
< source: https://guides.github.com/activities/hello-world/ >
Pull Requests: GitHub  旧
Pull request 螳語朱 覲蟆渚 伎 れ蟆  襴觀
襯 豌螻 れ branch merge 蟆 豌
Pull request branch 螳 谿伎  (豢螳 蟆: 轟,
 蟆: 觜螳)
commit  貊 螳覦 譬襭讌  pull request襯 open
 殊  螳
GitHub - Tutorial
Open a Pull Request
< source: https://guides.github.com/activities/hello-world/ >
1. Pull requests tab 企Ν  轟 New pull request 覯殊 企Ν
GitHub - Tutorial
Open a Pull Request
2. master branch 觜蟲 branch (readme-edits)襯 
< source: https://guides.github.com/activities/hello-world/ >
3.  螻 master 谿企ゼ 覲企伎 豕譬 豢 覿 
GitHub - Tutorial
Open a Pull Request
< source: https://guides.github.com/activities/hello-world/ >
4. 覲蟆曙 覓語螳 朱 Create Pull Request 覯殊 企Ν
GitHub - Tutorial
5. 覲蟆曙  る 覈螻 螳 る 蠍郁 Create Pull
request! 覯 企Ν
Open a Pull Request
< source: https://guides.github.com/activities/hello-world/ >
GitHub - Tutorial
Merge a Pull Request
readme-edits branch襯 master branch 蟷 merge 螻
1. 覲蟆 伎 master 豢螳蠍 伎 Merge pull request 覯殊 企Ν
2. Confirm merge 企Ν
3. 覲蟆曙 豢螳蠍 覓語 branch襯 蠍 伎 Delete
branch 覯殊 企Ν
< source: https://guides.github.com/activities/hello-world/ >
Local repository GitHub repository 郁屋蠍
Local Git remote repository 豢螳
GitHub - Tutorial
Local and Remote Repository
$git remote add origin https://github.com/username/myproject.git
覲語語
GitHub  企 (id)
郁屋る レ 企
(願化 myproject)
$git remote add [豢企] [url]
remote repository
豢螳
url 襦  remote repository レ 豢企
remote repository url
豢企 origin
Local repository GitHub repository 郁屋蠍
GitHub - Tutorial
Local and Remote Repository
github github.com/geunhkim/WebProgramming.git origin企朱 企朱 豢螳
Local repository 豢螳 remote repository 
$git remote
蟆郁骸
Local repository 豢螳 remote repository  覲
GitHub - Tutorial
Local and Remote Repository
Local repository 伎 Remote Repository upload 蠍
Local 伎 overwrite 蠍
push 蟠 螳讌螻 讌  襦語 谿語螻  蟆曙一 襦碁ゼ fork襯
 
fork覃 GitHub 襦碁ゼ 旧Ц襦  れろ伎る 覲旧蠍 覓語 push襯
  
GitHub - Tutorial
Contributing to a project
谿語 襦語 Fork button 企Ν覃  れろ伎る 覲旧
geunkim/WebProgramming geunhyung/WebProgramming
朱 fork 伎
GitHub - Tutorial
Contributing to a project
geunhyung れろ伎れ 覲蟆曙 觜蟲 覃
GitHub -Tutorial
Contributing to a project
geunkim れろ伎れ pull request  蟆郁骸
GitHub - Tutorial
Contributing to a project
GitHub
Web Programming Repository
https://github.com/geunhkim/WebProgramming.git
References
覯蟯襴襯 れ企蓋   れ  DVCS - Git: http://
www.slideshare.net/ibare/dvcs-git
Git 伎  襦 覦一郁鍵: http://blog.appkr.kr/learn-n-think/
comparing-workflows/
Become a git guru: https://www.atlassian.com/git/tutorials
碁朱 れり疑, Git, 覿磯 蟯襴 ろ, (語企)
git  everything-is-local: https://git-scm.com/doc
Pro Git book: https://git-scm.com/book/en/v2 (蠍 覯 譟伎)
Giancarlo Lionetti: What is Version Control: Centralized vs. DVCS
Adding an existing project to GitHub using command line: https://
help.github.com/articles/adding-an-existing-project-to-github-using-the-
command-line/

More Related Content

What's hot (20)

Git 螳企
Git  螳企Git  螳企
Git 螳企
svn ルレ襯 git 螳 螳企
svn ルレ襯  git 螳 螳企svn ルレ襯  git 螳 螳企
svn ルレ襯 git 螳 螳企
Insub Lee
梶 釈メ梶 堰= 求 求求
梶 釈メ梶 堰= 求 求求梶 釈メ梶 堰= 求 求求
梶 釈メ梶 堰= 求 求求
Matthew ()
メメ求求梶 釈過
メメ求求梶 釈過 メメ求求梶 釈過
メメ求求梶 釈過
Jong-il Seok
[NDC16] Effective Git
[NDC16] Effective Git[NDC16] Effective Git
[NDC16] Effective Git
Chanwoong Kim
Git 蠍 GitHub(Git企殊伎誤 ) / Getting started with git+github
Git 蠍 GitHub(Git企殊伎誤 ) / Getting started with git+githubGit 蠍 GitHub(Git企殊伎誤 ) / Getting started with git+github
Git 蠍 GitHub(Git企殊伎誤 ) / Getting started with git+github
Junyoung Lee
覯蟯襴襯 れ企蓋 れ DVCS - Git
覯蟯襴襯 れ企蓋  れ  DVCS - Git覯蟯襴襯 れ企蓋  れ  DVCS - Git
覯蟯襴襯 れ企蓋 れ DVCS - Git
覩狩 蟾
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
Sanggyu Nam
140109 襦
140109 襦 140109 襦
140109 襦
Git ≡п戟 =
Git ≡п戟 =Git ≡п戟 =
Git ≡п戟 =
Git
GitGit
Git
Junyoung Lee
Git 覓語襯 螳企
Git 覓語襯  螳企Git 覓語襯  螳企
Git 覓語襯 螳企
chandler0201
Git 蠍 GitHub(蟲襴IDE 蟆)
Git 蠍 GitHub(蟲襴IDE 蟆)Git 蠍 GitHub(蟲襴IDE 蟆)
Git 蠍 GitHub(蟲襴IDE 蟆)
Junyoung Lee
Git 螳覲
Git   螳覲Git   螳覲
Git 螳覲
Byeol Kang
Git 貊 ろ磯 2
Git 貊 ろ磯 2Git 貊 ろ磯 2
Git 貊 ろ磯 2
豪企 螻旧
Git 覯 螻旧 + Unity3D with git
Git 覯 螻旧 + Unity3D with gitGit 覯 螻旧 + Unity3D with git
Git 覯 螻旧 + Unity3D with git
SeongSik Kim
危企曙る GIT 蠍
危企曙る GIT 蠍危企曙る GIT 蠍
危企曙る GIT 蠍
一 譯
Github 覯
Github 覯Github 覯
Github 覯
jong seok Kim
Git & Github Seminar-2
Git & Github Seminar-2Git & Github Seminar-2
Git & Github Seminar-2
sangyun han
2011 KTH H3 貉朱一 Track B, 語4 "Advanced Git" by A.J
2011 KTH H3 貉朱一 Track B, 語4 "Advanced Git" by A.J2011 KTH H3 貉朱一 Track B, 語4 "Advanced Git" by A.J
2011 KTH H3 貉朱一 Track B, 語4 "Advanced Git" by A.J
Andrew J. Kim
Git 螳企
Git  螳企Git  螳企
Git 螳企
svn ルレ襯 git 螳 螳企
svn ルレ襯  git 螳 螳企svn ルレ襯  git 螳 螳企
svn ルレ襯 git 螳 螳企
Insub Lee
梶 釈メ梶 堰= 求 求求
梶 釈メ梶 堰= 求 求求梶 釈メ梶 堰= 求 求求
梶 釈メ梶 堰= 求 求求
Matthew ()
メメ求求梶 釈過
メメ求求梶 釈過 メメ求求梶 釈過
メメ求求梶 釈過
Jong-il Seok
[NDC16] Effective Git
[NDC16] Effective Git[NDC16] Effective Git
[NDC16] Effective Git
Chanwoong Kim
Git 蠍 GitHub(Git企殊伎誤 ) / Getting started with git+github
Git 蠍 GitHub(Git企殊伎誤 ) / Getting started with git+githubGit 蠍 GitHub(Git企殊伎誤 ) / Getting started with git+github
Git 蠍 GitHub(Git企殊伎誤 ) / Getting started with git+github
Junyoung Lee
覯蟯襴襯 れ企蓋 れ DVCS - Git
覯蟯襴襯 れ企蓋  れ  DVCS - Git覯蟯襴襯 れ企蓋  れ  DVCS - Git
覯蟯襴襯 れ企蓋 れ DVCS - Git
覩狩 蟾
140109 襦
140109 襦 140109 襦
140109 襦
Git ≡п戟 =
Git ≡п戟 =Git ≡п戟 =
Git ≡п戟 =
Git 覓語襯 螳企
Git 覓語襯  螳企Git 覓語襯  螳企
Git 覓語襯 螳企
chandler0201
Git 蠍 GitHub(蟲襴IDE 蟆)
Git 蠍 GitHub(蟲襴IDE 蟆)Git 蠍 GitHub(蟲襴IDE 蟆)
Git 蠍 GitHub(蟲襴IDE 蟆)
Junyoung Lee
Git 覯 螻旧 + Unity3D with git
Git 覯 螻旧 + Unity3D with gitGit 覯 螻旧 + Unity3D with git
Git 覯 螻旧 + Unity3D with git
SeongSik Kim
危企曙る GIT 蠍
危企曙る GIT 蠍危企曙る GIT 蠍
危企曙る GIT 蠍
一 譯
Git & Github Seminar-2
Git & Github Seminar-2Git & Github Seminar-2
Git & Github Seminar-2
sangyun han
2011 KTH H3 貉朱一 Track B, 語4 "Advanced Git" by A.J
2011 KTH H3 貉朱一 Track B, 語4 "Advanced Git" by A.J2011 KTH H3 貉朱一 Track B, 語4 "Advanced Git" by A.J
2011 KTH H3 貉朱一 Track B, 語4 "Advanced Git" by A.J
Andrew J. Kim

Similar to 11. git basic (20)

[ろれ雑ろ]Subversion vs git - 谿語 螳
[ろれ雑ろ]Subversion vs git - 谿語   螳[ろれ雑ろ]Subversion vs git - 谿語   螳
[ろれ雑ろ]Subversion vs git - 谿語 螳
Ji-Woong Choi
[17.02.09] Github introduction (Korean Version)
[17.02.09] Github introduction (Korean Version)[17.02.09] Github introduction (Korean Version)
[17.02.09] Github introduction (Korean Version)
Ildoo Kim
Git 蠍磯蓋
Git 蠍磯蓋Git 蠍磯蓋
Git 蠍磯蓋
HyunWook Kang
Git 覿磯蟯襴 ろ(1)
Git 覿磯蟯襴 ろ(1)Git 覿磯蟯襴 ろ(1)
Git 覿磯蟯襴 ろ(1)
Hyunjun Roh
Git basic2 chaos
Git basic2 chaosGit basic2 chaos
Git basic2 chaos
Yunkyu Choi
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
MDLicht
Git: A Motivating Introduction
Git: A Motivating IntroductionGit: A Motivating Introduction
Git: A Motivating Introduction
Jongwook Choi
Git lecture1
Git lecture1Git lecture1
Git lecture1
ssuseraf62e91
襴ろ襷 碁碁 - Git, Github 覲願鍵
襴ろ襷 碁碁 - Git, Github 覲願鍵襴ろ襷 碁碁 - Git, Github 覲願鍵
襴ろ襷 碁碁 - Git, Github 覲願鍵
Wooyoung Ko
Git server (git olite,gitweb)
Git server (git olite,gitweb)Git server (git olite,gitweb)
Git server (git olite,gitweb)
讌 覦
Git basic
Git basicGit basic
Git basic
覩殊 蟾
Git & GitHub
Git & GitHubGit & GitHub
Git & GitHub
Jongmin Park
Git & Github Seminar-1
Git & Github Seminar-1Git & Github Seminar-1
Git & Github Seminar-1
sangyun han
Git from google techtalks by Randal
Git from google techtalks by RandalGit from google techtalks by Randal
Git from google techtalks by Randal
yagurchoi
蟾觚 蠍
蟾觚 蠍蟾觚 蠍
蟾觚 蠍
Git 貊 ろ磯 1
Git 貊 ろ磯 1Git 貊 ろ磯 1
Git 貊 ろ磯 1
豪企 螻旧
[VCS] Git&GitLab_Designer
[VCS] Git&GitLab_Designer[VCS] Git&GitLab_Designer
[VCS] Git&GitLab_Designer
Lee Beomho
[ろれ雑ろ] Docker襯 Gitlab CI/CD 蟲 ろ
[ろれ雑ろ] Docker襯  Gitlab CI/CD 蟲 ろ[ろれ雑ろ] Docker襯  Gitlab CI/CD 蟲 ろ
[ろれ雑ろ] Docker襯 Gitlab CI/CD 蟲 ろ
Ji-Woong Choi
[ろれ雑ろ]Subversion vs git - 谿語 螳
[ろれ雑ろ]Subversion vs git - 谿語   螳[ろれ雑ろ]Subversion vs git - 谿語   螳
[ろれ雑ろ]Subversion vs git - 谿語 螳
Ji-Woong Choi
[17.02.09] Github introduction (Korean Version)
[17.02.09] Github introduction (Korean Version)[17.02.09] Github introduction (Korean Version)
[17.02.09] Github introduction (Korean Version)
Ildoo Kim
Git 覿磯蟯襴 ろ(1)
Git 覿磯蟯襴 ろ(1)Git 覿磯蟯襴 ろ(1)
Git 覿磯蟯襴 ろ(1)
Hyunjun Roh
Git basic2 chaos
Git basic2 chaosGit basic2 chaos
Git basic2 chaos
Yunkyu Choi
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
MDLicht
Git: A Motivating Introduction
Git: A Motivating IntroductionGit: A Motivating Introduction
Git: A Motivating Introduction
Jongwook Choi
襴ろ襷 碁碁 - Git, Github 覲願鍵
襴ろ襷 碁碁 - Git, Github 覲願鍵襴ろ襷 碁碁 - Git, Github 覲願鍵
襴ろ襷 碁碁 - Git, Github 覲願鍵
Wooyoung Ko
Git server (git olite,gitweb)
Git server (git olite,gitweb)Git server (git olite,gitweb)
Git server (git olite,gitweb)
讌 覦
Git & Github Seminar-1
Git & Github Seminar-1Git & Github Seminar-1
Git & Github Seminar-1
sangyun han
Git from google techtalks by Randal
Git from google techtalks by RandalGit from google techtalks by Randal
Git from google techtalks by Randal
yagurchoi
蟾觚 蠍
蟾觚 蠍蟾觚 蠍
蟾觚 蠍
[VCS] Git&GitLab_Designer
[VCS] Git&GitLab_Designer[VCS] Git&GitLab_Designer
[VCS] Git&GitLab_Designer
Lee Beomho
[ろれ雑ろ] Docker襯 Gitlab CI/CD 蟲 ろ
[ろれ雑ろ] Docker襯  Gitlab CI/CD 蟲 ろ[ろれ雑ろ] Docker襯  Gitlab CI/CD 蟲 ろ
[ろれ雑ろ] Docker襯 Gitlab CI/CD 蟲 ろ
Ji-Woong Choi

More from Geunhyung Kim (7)

7. sorting
7. sorting7. sorting
7. sorting
Geunhyung Kim
6. binary tree
6. binary tree6. binary tree
6. binary tree
Geunhyung Kim
5.node js
5.node js5.node js
5.node js
Geunhyung Kim
5. queue
5. queue5. queue
5. queue
Geunhyung Kim
4. stack
4. stack4. stack
4. stack
Geunhyung Kim
1. introduction to algorithm
1. introduction to algorithm1. introduction to algorithm
1. introduction to algorithm
Geunhyung Kim
3. linked list
3. linked list3. linked list
3. linked list
Geunhyung Kim

11. git basic

  • 1. Geun-Hyung Kim UMCL @ Dong-Eui University Introduction to Git/GitHub
  • 2. 覯 蟯襴 ろ Local Version Control / Central Version Control / Distributed Version Control Git - Basic Git - Tutorial : Just doing small work with Git Configuration Create Repository Git Workflow GitHub - Tutorial: Just doing small work with remote storage Create/Delete Repository Create branch Open Pull Request /Merge Pull Request 覈 谿 願 伎
  • 3. Version Control System What is Version Control? A category of software tools that help a software team manage changes to source code over time. (語 螳覦 螳覦 譴 れ 覲蟆 蟯襴襯 蟲) 覯 蟯襴 ろ 覈 覲襯 螳 磯 覯 蟯襴 一危磯伎れ 蠍磯 譴 轟 覯 れ 蟶朱伎 ろ 蠏碁 企 企 覯 蟯襴 ろ(VCS - Version Control System) 螳 VCS襦 企語 伎 覯(覲蟆 企 轟 伎) 蟯襴 蟆 覈
  • 4. 螳 殊 伎 襦 襴 襦 豌企ゼ 伎 襦 螳 磯 伎 觜蟲 覲 螳 覓語襯 殊殊式讌 豢 VCS襯 覃 蟇磯 覈 所 覲糾規 Benefits (レ) A complete long-term change history of every file , , 覲蟆所骸 螳 覲蟆曙 豌 ろ襴襯 蠍磯螻 螻手碓 覯 伎 螳 Branching and merging branch(觚豺) 蠍磯レ 伎 螳覦 螳 螳覦れ 螳 觚豺 襦 豢 覦讌 蟆讀 蟆郁骸襯 牛 豕譬 螳覦 覦壱 覯 蟆一 Traceability 螳 覲蟆曙 覈螻 襯 る 譯殊 襦 覲蟆曙 豢 螳 Version Control System What can we do with VCS?
  • 5. 螳 襦貉 一危磯伎るゼ 殊 覲蟆 覲企ゼ 蟯襴 RCS (Revision Control System): 殊 覲蟆暑 覿覿 (Patch Set) 覲 朱 ロ 殊 轟 朱 襴 Version Control System Local Version Control Check-in Check-out <source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics>
  • 6. るジ 螳覦 蟷 覃 覯 蟯襴襯 ろ語 覯襯 伎 覦 覯 (: CVS, Subversion, Perforce 螳 ろ ) レ: 襦語 谿語 螳覦 螳 覓伎 螻 讌 蟯襴 , VCS襦 蟯襴 螳 : 譴 覯螳 覓語螳 覦覃 覦煙 覦覯 Version Control System Centralized VCS (CVCS) <source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics> Check-in (Commit) Check-out Check-in (Commit) Check-out
  • 7. Version Control System Distributed VCS (DVCS) レ 豌企ゼ 襦貉 語ろ碁 覲旧 覃 覯 蟯襴襯 , ろ語 覯襯 伎 Check-in (Commit) Check-out pull (clone) push レ: ろ語 覯 レ螳 覦 螳覲 螳覦 襦貉 貉 一 讌 螳 れ 襦 螳 : 覦企襴 一危磯ゼ ロ 蟆曙 螻糾 襷 谿讌 ろ襴螳 襷 蟆曙 れ企 螻 襦 襷 螳 : Git, Mecurial, Bazaar <source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics>
  • 9. Developed as the version control system for Linux Kernel Project (襴 貉る 襦碁ゼ 覯 蟯襴 ろ朱 螳覦) Birth year: 2005 Initial purpose (豐蠍 覈) speed (觜襯 ) simple design ( 蟲譟) strong support for non-linear development (thousands of parallel branches) ( る 觚豺襯 牛 觜 螳覦) fully distributed (覯渚 覿) capable of handling large projects efficiently (襴 貉る 螳 襦 讌) Git History Linus Torvards
  • 10. Git thinks about its data more like a stream of snapshots. (Git 一危磯ゼ る結 ろ碁殊朱 螻) Every time you commit, or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot. (一危磯ゼ 螳語り碓 襦碁ゼ ロ 襷 蠏 殊 伎 る 血 蟲 蠏 蟆 朱一るゼ ) To be efficient, if files have not changed, Git doesnt store the file again, just a link to the previous identical file it has already stored. (覲蟆暑讌 殊 れ 殊 ロ讌 螻 伎 狩 殊 襷) Git Basic: snapshot <source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics>
  • 11. Everything is check-summed before it is stored and then is referred to by that checksum (一危磯ゼ ロ蠍 豌危 蟲覃 豌危 牛 一 磯ゼ 蟯襴) Git uses a SHA-1 hash for this checksumming (豌危 螻一 SHA-1 伎 ) 40-character string composed of hexadecimal characters (16讌 覓語 (0, 1,.., 9, a,b,.,,f)襦 蟲 焔 40螳 覓語) calculated based on the contents of a file or directory structure (殊 伎 襴 蟲 譟磯ゼ 蠍磯朱 螻) Git stores everything in its database not by file name but by the hash value of its contents (一危磯伎れ 企 貊豸 伎 螳 ) Git Basic: checksum hash value example
  • 12. Three main sections(瑚 ) Working directory ( 螻糾): a single checkout of one version of the project (襦語 轟 覯 朱る レ 豢 殊 螳語 レ) Staging Area (讌蟆一): a file, generally contained in your repository, that stores information about what will go into your next commit (れ 貉る 蟆 伎 覲企ゼ ロ螻 - 朱朱 レ ) Repository (レ): stores the metadata and object database for your project (襦語 覃一危一 螳豌 一危磯伎るゼ ロ 螻) Git Basic: three sections / states checkout Working Directory Staging Area Repository add commit
  • 13. Git has three main states that your files can reside in (Git 殊 螳讌 襦 蟯襴) Committed: the data is safely stored in your local database (一危郁 レ 蟆 ル ) Staged: you have marked a modified file in its current version to go into your next commit snapshot ( 覯 殊 れ 覯 ロ蠍 ) Modified: you have changed the file but have not committed it to your database yet (殊 朱 讌 レ レ ル讌 ) Git Basic: three sections / states (committed state) (staged state)(modified state) <source: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics>
  • 14. 1. modify files in your working directory ( 襴 殊 ) 2. stage the files, adding snapshots of them to your staging area (staging 殊 る血 燕 豢螳) 3. do a commit (staging 殊 レ ) Git Basic: Simple Workflow
  • 15. Just go to http://git-scm.com/download/win (automatic download) Git Install Git for Windows go to https://git-for-windows.github.io/
  • 16. Git Install Git for Windows Git Bash Git GUI Shell Integration
  • 17. Just doing small work with Git Configuration Git Work flow Create Repository
  • 18. Git - Tutorial Configuration Git れ 蟆曙 れ覃 譴 Git 覦 Git 蠏碁企 れ 伎 讌 git 企 覈轟 $ git config 伎伎 れ 伎 覲蟆 蟯 れ /etc/gitconfig : ろ 覈 覈 レ れ $ git config --system 旧朱 殊 ~/.gitconfig, ~/.config/git/config : 轟 蟆襷 れ $ git config --global 旧朱 殊 .git/config : Git 襴 螻 轟 レ(轟 譴 襦)襷 $ git config --local 旧朱 殊 : 襦 -> -> ろ 朱 Windows $HOME 襴 (襷 C:Users$USER 襴) .gitconfig
  • 19. Git - Tutorial Configuration $ git config user.name Geun-Hyung Kim $ git config user.email geunkimkorea@gmail.com $ git help config config (git 企 覈轟) る 豌 $ git config user.name Geun-Hyung Kim $ git config user.email geunkimkorea@gmail.com $ git help config config (git 企 覈轟) る 豌
  • 20. Git - Tutorial Create Repository $git init: 襴襯 誤 覈轟 gitstore朱 襦 襴襯 燕 覈轟 gitstore 襴襦 企 襴螳 geunkim 覦 gitstore 襴 襴 伎 誤 覈轟 git レ (.git 襴 ) 襯 豐蠍壱 覈轟 ~/gitstore/.git レ襯 豐蠍壱 git metadata襯 ロ 襴 .git 襴襯 襷り レ 蟯 metadata襯 . .git 襴螳 working directory git 覈轟企ゼ ろ Q) るジ 襦語 谿語蟇磯 Git レ襯 覲旧 り 苦 ? Windows cd襯
  • 21. Git - Tutorial Working Directory working directory $ git status:working directory repository 襯 豌危, 企 殊 working directory 讌, commit 覲蟆曙 讌 煙 working directory tracked untracked襦 untracked file 讌 git 蟯襴 tracked file git 伎 蟯襴 (企 レ staging area )
  • 22. create README.txt file add the file to staging area commit changes modified README.txt and create new LICENSE add both files to stage area commit changes Git - Tutorial Git Workflow
  • 23. Git - Tutorial Git Workflow: create README.txt vi ク讌蠍磯ゼ 伎 README.txt 襴 伎 豕蠏 commit 危襦 覲蟆曙 蟯襴讌 覈襦 commit蠍 豢螳 蟆 朱 untracked file 譟伎 襦蟆 焔
  • 24. Git - Tutorial Git Workflow: add file to staging area README.txt 殊 staging area add commit 覈襦 staging area
  • 25. Git - Tutorial Git Workflow: commit changes staging area 殊 レ 殊 伎 覓伎 讌 螳comment 伎version control master staging area working directory
  • 26. Git - Tutorial Git Workflow: modifies README.txt adds LICENSE README.txt LICENSE 襦蟆 master branch tracked file 譴 untracked file
  • 27. Git - Tutorial Git Workflow: add files to staging area / 覈 豢螳 $ git add README.txt LICENSE
  • 28. Git - Tutorial Git Workflow: commit changes
  • 29. Git - Tutorial Git TimeLine History $git log: レ commit ろ襴襯 螳 朱 覲伎譴, 螳 豕蠏殊 commit 蟆 螳 襾殊 豢 master
  • 30. To discard changes in working directory [working directory 覲蟆 伎 覓伎() る Git - Tutorial check out $ git checkout -- <fileName>
  • 31. Git - TutorialWeb Programming - Workflow 4 螳 殊 燕 git status 蟆郁骸 覃 4 螳 殊 staging area襦 豢螳 蟆郁骸
  • 32. Git - TutorialWeb Programming - Workflow 4 螳 殊 repository 螳 repository 豌危
  • 33. Just doing small work with Remote Storage (GitHub)
  • 34. What is GitHub ? Create a Repository Create a Branch Make and Commit Changes Open a Pull Request Merge a Pull Request GitHub - Tutorial < source: https://guides.github.com/activities/hello-world/ >
  • 35. a code hosting platform for version control and collaboration (覯 蟯襴 (code) 語ろ ) It lets you and others work together on project from anywhere (企 襦語 螳ロ襦 ) GitHub - Tutorial What is GitHub? master GitHub (Remte Repository) push pull pull < source: https://guides.github.com/activities/hello-world/ >
  • 36. 1. るジ讓 + 覃企ゼ New repository 襯 2. レ 企 hello-world 襦 . 3. 讌ъ る 4. Initialize this repository with a README 襯 5. Create repository襯 企Ν GitHub - Tutorial Create Repository repository 煙 覃 < source: https://guides.github.com/activities/hello-world/ >
  • 37. GitHub - Tutorial Create Repository < source: https://guides.github.com/activities/hello-world/ >
  • 38. 1. る レ襯 2. (れ) 3. 覃伎 覯殊 企Ν 4. レ 企 GitHub - Tutorial Delete Repository
  • 39. GitHub - Tutorial Create a Branch Branching: レ るジ 覯 覦覯 蠍磯蓋朱 レ 豕譬 覯(豕譬 branch) master朱 branch襯 螳讌 master commit蠍 ろ碁ゼ 蠍 branch襯 master branch襯 燕覃 蠏 master 覲旧 る血 master branch Create feature branch from master Merge feature branch into master Commit changes Submit Pull Request Discuss proposed changes < source: https://guides.github.com/activities/hello-world/ >
  • 40. 1. 襦 hello-world レ襯 2. branch: master 朱 覈襦 drop down 企Ν 3. 襦 branch text box branch 企 readme-edits襦 4. Creat branch box襯 螻 return GitHub - Tutorial Create a Branch < source: https://guides.github.com/activities/hello-world/ >
  • 41. GitHub - Tutorial Create a Branch branch 覈襦 branch 譯 branch
  • 42. readme-edit branch README.md 殊 企Ν file view るジ讓 壱 icon 企Ν editor 伎 覲蟆 伎 る commit message襯 Commit changes 覯殊 企Ν GitHub - Tutorial Make and commit changes < source: https://guides.github.com/activities/hello-world/ >
  • 43. Pull Requests: GitHub 旧 Pull request 螳語朱 覲蟆渚 伎 れ蟆 襴觀 襯 豌螻 れ branch merge 蟆 豌 Pull request branch 螳 谿伎 (豢螳 蟆: 轟, 蟆: 觜螳) commit 貊 螳覦 譬襭讌 pull request襯 open 殊 螳 GitHub - Tutorial Open a Pull Request < source: https://guides.github.com/activities/hello-world/ >
  • 44. 1. Pull requests tab 企Ν 轟 New pull request 覯殊 企Ν GitHub - Tutorial Open a Pull Request 2. master branch 觜蟲 branch (readme-edits)襯 < source: https://guides.github.com/activities/hello-world/ >
  • 45. 3. 螻 master 谿企ゼ 覲企伎 豕譬 豢 覿 GitHub - Tutorial Open a Pull Request < source: https://guides.github.com/activities/hello-world/ >
  • 46. 4. 覲蟆曙 覓語螳 朱 Create Pull Request 覯殊 企Ν GitHub - Tutorial 5. 覲蟆曙 る 覈螻 螳 る 蠍郁 Create Pull request! 覯 企Ν Open a Pull Request < source: https://guides.github.com/activities/hello-world/ >
  • 47. GitHub - Tutorial Merge a Pull Request readme-edits branch襯 master branch 蟷 merge 螻 1. 覲蟆 伎 master 豢螳蠍 伎 Merge pull request 覯殊 企Ν 2. Confirm merge 企Ν 3. 覲蟆曙 豢螳蠍 覓語 branch襯 蠍 伎 Delete branch 覯殊 企Ν < source: https://guides.github.com/activities/hello-world/ >
  • 48. Local repository GitHub repository 郁屋蠍 Local Git remote repository 豢螳 GitHub - Tutorial Local and Remote Repository $git remote add origin https://github.com/username/myproject.git 覲語語 GitHub 企 (id) 郁屋る レ 企 (願化 myproject) $git remote add [豢企] [url] remote repository 豢螳 url 襦 remote repository レ 豢企 remote repository url 豢企 origin
  • 49. Local repository GitHub repository 郁屋蠍 GitHub - Tutorial Local and Remote Repository github github.com/geunhkim/WebProgramming.git origin企朱 企朱 豢螳 Local repository 豢螳 remote repository $git remote 蟆郁骸 Local repository 豢螳 remote repository 覲
  • 50. GitHub - Tutorial Local and Remote Repository Local repository 伎 Remote Repository upload 蠍 Local 伎 overwrite 蠍
  • 51. push 蟠 螳讌螻 讌 襦語 谿語螻 蟆曙一 襦碁ゼ fork襯 fork覃 GitHub 襦碁ゼ 旧Ц襦 れろ伎る 覲旧蠍 覓語 push襯 GitHub - Tutorial Contributing to a project 谿語 襦語 Fork button 企Ν覃 れろ伎る 覲旧
  • 52. geunkim/WebProgramming geunhyung/WebProgramming 朱 fork 伎 GitHub - Tutorial Contributing to a project
  • 53. geunhyung れろ伎れ 覲蟆曙 觜蟲 覃 GitHub -Tutorial Contributing to a project
  • 54. geunkim れろ伎れ pull request 蟆郁骸 GitHub - Tutorial Contributing to a project
  • 56. References 覯蟯襴襯 れ企蓋 れ DVCS - Git: http:// www.slideshare.net/ibare/dvcs-git Git 伎 襦 覦一郁鍵: http://blog.appkr.kr/learn-n-think/ comparing-workflows/ Become a git guru: https://www.atlassian.com/git/tutorials 碁朱 れり疑, Git, 覿磯 蟯襴 ろ, (語企) git everything-is-local: https://git-scm.com/doc Pro Git book: https://git-scm.com/book/en/v2 (蠍 覯 譟伎) Giancarlo Lionetti: What is Version Control: Centralized vs. DVCS Adding an existing project to GitHub using command line: https:// help.github.com/articles/adding-an-existing-project-to-github-using-the- command-line/