SlideShare a Scribd company logo
1 of 14
GIT
Basic guide
Very basic
• Clone
• Add & Commit
• Push
Clone
• Git 서버에 있는 repository를 자신의 환경으로 복제하는 기능
• #git clone [repository경로]
Git server;remote
repository1
repository2
…
local
Cloning;복제
local
Cloning 작업 후 상태
repository1
Add & Commit
• 제출할 작업 목록으로 작업한 내용을 올려놓는 기능
• #git add [commit할 파일명]
#git commit –m “[commit 메시지]”
local
repository1 Commit list
수정된 코드1
adding
수정된 코드2
Added list
committing
Committing 작업 후 상태
local
repository1
Commit list
-m “버그수정”
버그수정
Push
• Commit 한 작업을 git server로 전송하는 기능
• #git push
local
repository1
Commit list
버그수정
Git server;remote
repository1
Basic
• Reset
• Fetch
• Pull
• Checkout
Reset
• Added list에 올려놓은 작업 내용을 초기화하는 기능
• #git reset
local
repository1
Added list
수정된 코드1
수정된 코드2
Git reset 수행 후 상태
local
repository1
수정된 코드1
수정된 코드2
Added list
[empty]
Fetch
• Remoterepository에서수정된사항을자신의환경으로가져오는기능
• #git fetch
master
local
작업1 ②작업2
HEAD
작업1
HEAD
①cloning
③로컬작업1
④pushing
! Fetch first
Fetching 작업 후 상태
local
repository1
Added list
작업2로컬작업1
Fetched list
Pull
• Fetch 한 후 자신의 환경으로 해당 작업을 병합하는 기능
• #git pull
master
local
작업1 ②작업2
HEAD
작업1
HEAD
①cloning
③로컬작업1
④pushing
! Fetch first
Pulling 작업 후 상태
local
repository1
Added list
작업2로컬작업1
원래 있었던 것 처럼 병합됨
Checkout
• Branch 를 다루는 기능
• #git checkout –b [생성할 branch 명]
• #git checkout [변경할 branch 명]
• #git checkout –d [제거할 branch 명]
여러 작업을 동시에 진행해야 하거나, 기능별 적용 일정이 다를 경우
master 작업1
작업2branch1
작업3branch2
작업…
열일…
pushing
pushing
More
• Cherry pick
• Squash
• Stash
Cherry-pick
• 특정 commit을 가져오는 기능
• #git cherry-pick [commit]
다른 branch에서 작업한 내용중 일부가 필요할 경우
master 작업1
작업2branch1 Bugfix 다른작업
작업이 안끝나서 그대로 pull 수행하면 에러날 때
Cherry picking
Bugfix
Squash
• 여러 commit을 하나로 통합하는 개념
하나의 작업이 여러 commit으로 나뉘어져 있는 경우, commit history 관리를 위해 통합 작업 필요
master 작업1
작업2작업2-branch 작업2-오타수정
HEAD
Squash [작업2+오타수정]
HEAD
HEAD를 작업의 시작으로 이동시킨 후, commit을 수행
Stash
• 현재 작업 중인 내용을 임시 stack에 올려 두는 기능
• #git stash
master 작업1
작업2branch1
현재 진행중인 작업이 안끝났는데 다른 branch에서 quick fix가 필요한 경우
①Quick fix required
작업2
③ 작업1 ④bugfix
pushing
stash
②stashing ⑤ stash pop
작업2
⑥작업 재진행

More Related Content

What's hot

Open stack swift 디버깅 시작하기
Open stack swift 디버깅 시작하기Open stack swift 디버깅 시작하기
Open stack swift 디버깅 시작하기영우 김
 
[기초] GIT 교육 자료
[기초] GIT 교육 자료[기초] GIT 교육 자료
[기초] GIT 교육 자료JUNPIL PARK
 
Git 과 GitHub 를 이용한 버전관리와 협업 - 2주차A - 비교하기와 되돌리기
Git 과 GitHub 를 이용한 버전관리와 협업 - 2주차A - 비교하기와 되돌리기Git 과 GitHub 를 이용한 버전관리와 협업 - 2주차A - 비교하기와 되돌리기
Git 과 GitHub 를 이용한 버전관리와 협업 - 2주차A - 비교하기와 되돌리기Youngbin Han
 
파이참 원격 디버깅
파이참 원격 디버깅파이참 원격 디버깅
파이참 원격 디버깅영우 김
 
Git server 구축(git olite,gitweb)
Git server 구축(git olite,gitweb)Git server 구축(git olite,gitweb)
Git server 구축(git olite,gitweb)진혁 박
 
Tortoise svn의 설치와 기본
Tortoise svn의 설치와 기본Tortoise svn의 설치와 기본
Tortoise svn의 설치와 기본smgal
 
git, 이해부터 활용까지
git, 이해부터 활용까지git, 이해부터 활용까지
git, 이해부터 활용까지jylee1229
 
NationBildGuid
NationBildGuidNationBildGuid
NationBildGuidmerveiede
 
Git 분산버전관리 시스템(1)
Git 분산버전관리 시스템(1)Git 분산버전관리 시스템(1)
Git 분산버전관리 시스템(1)Hyunjun Roh
 
[숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습
[숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습 [숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습
[숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습 Soongsil University
 
Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션Dabi Ahn
 
Git & Github Seminar-2
Git & Github Seminar-2Git & Github Seminar-2
Git & Github Seminar-2sangyun han
 
레일스가이드 한글번역 공개프로젝트 RORLabGuides 소개
레일스가이드 한글번역 공개프로젝트 RORLabGuides 소개레일스가이드 한글번역 공개프로젝트 RORLabGuides 소개
레일스가이드 한글번역 공개프로젝트 RORLabGuides 소개RORLAB
 
클린코드 16장
클린코드 16장클린코드 16장
클린코드 16장진화 손
 
Git이란 (Git 소개 및 기초 이론)
Git이란 (Git 소개 및 기초 이론)Git이란 (Git 소개 및 기초 이론)
Git이란 (Git 소개 및 기초 이론)승용 윤
 
How to use Github? (For Cien)
How to use Github? (For Cien)How to use Github? (For Cien)
How to use Github? (For Cien)민수 김
 

What's hot (20)

Git tutorials
Git tutorialsGit tutorials
Git tutorials
 
Open stack swift 디버깅 시작하기
Open stack swift 디버깅 시작하기Open stack swift 디버깅 시작하기
Open stack swift 디버깅 시작하기
 
[기초] GIT 교육 자료
[기초] GIT 교육 자료[기초] GIT 교육 자료
[기초] GIT 교육 자료
 
Git 과 GitHub 를 이용한 버전관리와 협업 - 2주차A - 비교하기와 되돌리기
Git 과 GitHub 를 이용한 버전관리와 협업 - 2주차A - 비교하기와 되돌리기Git 과 GitHub 를 이용한 버전관리와 협업 - 2주차A - 비교하기와 되돌리기
Git 과 GitHub 를 이용한 버전관리와 협업 - 2주차A - 비교하기와 되돌리기
 
파이참 원격 디버깅
파이참 원격 디버깅파이참 원격 디버깅
파이참 원격 디버깅
 
Git server 구축(git olite,gitweb)
Git server 구축(git olite,gitweb)Git server 구축(git olite,gitweb)
Git server 구축(git olite,gitweb)
 
Tortoise svn의 설치와 기본
Tortoise svn의 설치와 기본Tortoise svn의 설치와 기본
Tortoise svn의 설치와 기본
 
git, 이해부터 활용까지
git, 이해부터 활용까지git, 이해부터 활용까지
git, 이해부터 활용까지
 
NationBildGuid
NationBildGuidNationBildGuid
NationBildGuid
 
Git 분산버전관리 시스템(1)
Git 분산버전관리 시스템(1)Git 분산버전관리 시스템(1)
Git 분산버전관리 시스템(1)
 
[숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습
[숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습 [숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습
[숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습
 
Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션
 
Git & Github Seminar-2
Git & Github Seminar-2Git & Github Seminar-2
Git & Github Seminar-2
 
레일스가이드 한글번역 공개프로젝트 RORLabGuides 소개
레일스가이드 한글번역 공개프로젝트 RORLabGuides 소개레일스가이드 한글번역 공개프로젝트 RORLabGuides 소개
레일스가이드 한글번역 공개프로젝트 RORLabGuides 소개
 
Git 코드랩 스터디 2
Git 코드랩 스터디 2Git 코드랩 스터디 2
Git 코드랩 스터디 2
 
클린코드 16장
클린코드 16장클린코드 16장
클린코드 16장
 
11. git basic
11. git basic11. git basic
11. git basic
 
git-basic-commands
git-basic-commandsgit-basic-commands
git-basic-commands
 
Git이란 (Git 소개 및 기초 이론)
Git이란 (Git 소개 및 기초 이론)Git이란 (Git 소개 및 기초 이론)
Git이란 (Git 소개 및 기초 이론)
 
How to use Github? (For Cien)
How to use Github? (For Cien)How to use Github? (For Cien)
How to use Github? (For Cien)
 

Similar to Git 기본 가이드

Git 사용 가이드
Git 사용 가이드Git 사용 가이드
Git 사용 가이드도형 임
 
Yobi-hands-on-lab-at-d2fest
Yobi-hands-on-lab-at-d2festYobi-hands-on-lab-at-d2fest
Yobi-hands-on-lab-at-d2festinsanehong Kim
 
[D2 fest 2014]yobi hands on lab
[D2 fest 2014]yobi hands on lab[D2 fest 2014]yobi hands on lab
[D2 fest 2014]yobi hands on labNAVER D2
 
오픈소스GIS 개발 일반 강의자료
오픈소스GIS 개발 일반 강의자료오픈소스GIS 개발 일반 강의자료
오픈소스GIS 개발 일반 강의자료BJ Jang
 
0508. git basic
0508. git basic0508. git basic
0508. git basic민정 김
 
201017 한주현 생물정보학 github 강의
201017 한주현 생물정보학 github 강의201017 한주현 생물정보학 github 강의
201017 한주현 생물정보학 github 강의Joohyun Han
 
Git Tutorial
Git TutorialGit Tutorial
Git TutorialMDLicht
 
오픈소스 개발을 위한 Git 사용법 실습
오픈소스 개발을 위한 Git 사용법 실습오픈소스 개발을 위한 Git 사용법 실습
오픈소스 개발을 위한 Git 사용법 실습BJ Jang
 
[VCS] Git&GitLab_Designer
[VCS] Git&GitLab_Designer[VCS] Git&GitLab_Designer
[VCS] Git&GitLab_DesignerLee Beomho
 
Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)Junyoung Lee
 
Git basic2 chaos
Git basic2 chaosGit basic2 chaos
Git basic2 chaosYunkyu Choi
 
[NDC16] Effective Git
[NDC16] Effective Git[NDC16] Effective Git
[NDC16] Effective GitChanwoong 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+githubJunyoung Lee
 
제로부터시작하는Git
제로부터시작하는Git제로부터시작하는Git
제로부터시작하는GitMario Cho
 
Git 입문자를 위한 가이드
Git 입문자를 위한 가이드Git 입문자를 위한 가이드
Git 입문자를 위한 가이드chandler0201
 

Similar to Git 기본 가이드 (20)

Git 사용 가이드
Git 사용 가이드Git 사용 가이드
Git 사용 가이드
 
Yobi-hands-on-lab-at-d2fest
Yobi-hands-on-lab-at-d2festYobi-hands-on-lab-at-d2fest
Yobi-hands-on-lab-at-d2fest
 
[D2 fest 2014]yobi hands on lab
[D2 fest 2014]yobi hands on lab[D2 fest 2014]yobi hands on lab
[D2 fest 2014]yobi hands on lab
 
오픈소스GIS 개발 일반 강의자료
오픈소스GIS 개발 일반 강의자료오픈소스GIS 개발 일반 강의자료
오픈소스GIS 개발 일반 강의자료
 
0508. git basic
0508. git basic0508. git basic
0508. git basic
 
Git
GitGit
Git
 
201017 한주현 생물정보학 github 강의
201017 한주현 생물정보학 github 강의201017 한주현 생물정보학 github 강의
201017 한주현 생물정보학 github 강의
 
Git
GitGit
Git
 
Git lecture2
Git lecture2Git lecture2
Git lecture2
 
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
 
오픈소스 개발을 위한 Git 사용법 실습
오픈소스 개발을 위한 Git 사용법 실습오픈소스 개발을 위한 Git 사용법 실습
오픈소스 개발을 위한 Git 사용법 실습
 
[VCS] Git&GitLab_Designer
[VCS] Git&GitLab_Designer[VCS] Git&GitLab_Designer
[VCS] Git&GitLab_Designer
 
Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)
 
Git lecture1
Git lecture1Git lecture1
Git lecture1
 
Git basic2 chaos
Git basic2 chaosGit basic2 chaos
Git basic2 chaos
 
[NDC16] Effective Git
[NDC16] Effective Git[NDC16] Effective Git
[NDC16] Effective Git
 
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
 
제로부터시작하는Git
제로부터시작하는Git제로부터시작하는Git
제로부터시작하는Git
 
Git command
Git commandGit command
Git command
 
Git 입문자를 위한 가이드
Git 입문자를 위한 가이드Git 입문자를 위한 가이드
Git 입문자를 위한 가이드
 

Git 기본 가이드

  • 2. Very basic • Clone • Add & Commit • Push
  • 3. Clone • Git 서버에 있는 repository를 자신의 환경으로 복제하는 기능 • #git clone [repository경로] Git server;remote repository1 repository2 … local Cloning;복제 local Cloning 작업 후 상태 repository1
  • 4. Add & Commit • 제출할 작업 목록으로 작업한 내용을 올려놓는 기능 • #git add [commit할 파일명] #git commit –m “[commit 메시지]” local repository1 Commit list 수정된 코드1 adding 수정된 코드2 Added list committing Committing 작업 후 상태 local repository1 Commit list -m “버그수정” 버그수정
  • 5. Push • Commit 한 작업을 git server로 전송하는 기능 • #git push local repository1 Commit list 버그수정 Git server;remote repository1
  • 6. Basic • Reset • Fetch • Pull • Checkout
  • 7. Reset • Added list에 올려놓은 작업 내용을 초기화하는 기능 • #git reset local repository1 Added list 수정된 코드1 수정된 코드2 Git reset 수행 후 상태 local repository1 수정된 코드1 수정된 코드2 Added list [empty]
  • 8. Fetch • Remoterepository에서수정된사항을자신의환경으로가져오는기능 • #git fetch master local 작업1 ②작업2 HEAD 작업1 HEAD ①cloning ③로컬작업1 ④pushing ! Fetch first Fetching 작업 후 상태 local repository1 Added list 작업2로컬작업1 Fetched list
  • 9. Pull • Fetch 한 후 자신의 환경으로 해당 작업을 병합하는 기능 • #git pull master local 작업1 ②작업2 HEAD 작업1 HEAD ①cloning ③로컬작업1 ④pushing ! Fetch first Pulling 작업 후 상태 local repository1 Added list 작업2로컬작업1 원래 있었던 것 처럼 병합됨
  • 10. Checkout • Branch 를 다루는 기능 • #git checkout –b [생성할 branch 명] • #git checkout [변경할 branch 명] • #git checkout –d [제거할 branch 명] 여러 작업을 동시에 진행해야 하거나, 기능별 적용 일정이 다를 경우 master 작업1 작업2branch1 작업3branch2 작업… 열일… pushing pushing
  • 11. More • Cherry pick • Squash • Stash
  • 12. Cherry-pick • 특정 commit을 가져오는 기능 • #git cherry-pick [commit] 다른 branch에서 작업한 내용중 일부가 필요할 경우 master 작업1 작업2branch1 Bugfix 다른작업 작업이 안끝나서 그대로 pull 수행하면 에러날 때 Cherry picking Bugfix
  • 13. Squash • 여러 commit을 하나로 통합하는 개념 하나의 작업이 여러 commit으로 나뉘어져 있는 경우, commit history 관리를 위해 통합 작업 필요 master 작업1 작업2작업2-branch 작업2-오타수정 HEAD Squash [작업2+오타수정] HEAD HEAD를 작업의 시작으로 이동시킨 후, commit을 수행
  • 14. Stash • 현재 작업 중인 내용을 임시 stack에 올려 두는 기능 • #git stash master 작업1 작업2branch1 현재 진행중인 작업이 안끝났는데 다른 branch에서 quick fix가 필요한 경우 ①Quick fix required 작업2 ③ 작업1 ④bugfix pushing stash ②stashing ⑤ stash pop 작업2 ⑥작업 재진행