"Git"의 두 판 사이의 차이

오픈소스 비즈니스 컨설팅
둘러보기로 가기 검색하러 가기
잔글
잔글
38번째 줄: 38번째 줄:
  
 
[http://git-scm.com/download/win Git 다운로드 사이트]에서 Windows용 Git 설치 파일(Git-1.9.4-preview20140815.exe)을 다운로드하여 설치 합니다.
 
[http://git-scm.com/download/win Git 다운로드 사이트]에서 Windows용 Git 설치 파일(Git-1.9.4-preview20140815.exe)을 다운로드하여 설치 합니다.
 +
 +
P:/001_work/gitRepositor/ 폴더를 만들고 해당 폴더에서 오른쪽 마우스를 클릭 합니다.
 +
 +
[[File:Git install 001.png]]
  
 
참고 문헌
 
참고 문헌
  
*http://forum.falinux.com/zbxe/index.php?document_srl=588283&mid=lecture_tip
+
*[http://forum.falinux.com/zbxe/index.php?document_srl=588283&mid=lecture_tip http://forum.falinux.com/zbxe/index.php?document_srl=588283&mid=lecture_tip]
 +
*http://insanehong.kr/post/guide-to-git-for-windows/
  
 
=== CentOS에서 git 설치 ===
 
=== CentOS에서 git 설치 ===

2014년 9월 29일 (월) 14:30 판

오픈소스 분산 버전 컨트롤 시스템인 git를 정리 한다.


Git 개요

Git은 로컬 저장소를 가지며 SnapShot 형태로 버전을 관리 합니다.


Git 저장소

  • Work Space : 개인별 작업 공간
  • Staging Area (index) : Commit할 파일을 지정 (git add)
  • 로컬 저장소 : 자신이 작업한 내용을 반영 (git commit, git commit -a)
  • 원격 저장소 : 다른 사람과 작업을 공유할 때 사용 (git push / git pull (git fetch, git merge))
  • Work Space -> Staging Area (index) -> Local Storage -> Remote Storage


Master and Branch

  • Master : 메인 코드 (git checkout master, git merge branch)
  • Branch : 새로 작업을 위해 생성한 코드 (git branch, git checkout, git checkbout -b)

Git 설치

Windows에서 git 설치

Git 다운로드 사이트에서 Windows용 Git 설치 파일(Git-1.9.4-preview20140815.exe)을 다운로드하여 설치 합니다.

P:/001_work/gitRepositor/ 폴더를 만들고 해당 폴더에서 오른쪽 마우스를 클릭 합니다.

Git install 001.png

참고 문헌

CentOS에서 git 설치

  • 설치
yum install git
git version

Git 명령어

  • 저장소 : Work Space -> Staging Area (index) -> Local Storage -> Remote Storage
  • 버전 : Master, Branch
분류 명령어 상세
초기 설정 git init 로컬 저장소 생성
git remote add <repository> 리모트 저장소 연결
Repository : user@password:/~/~
git clone <repository> 로컬 저장소로 리모트 저장소 복제
저장하기 git add Staging Area로 추가
git reset HEAD Staging Area에 추가할 파일을 삭제
git commit 로컬 저장소로 commit
git commit -a git add + git commit
git fetch origin
git reset --hard origin/master
로컬 저장소로 commit한 것을 복구
git push 리모트 저장소로 commit
가져오기 git fetch 로컬 저장소로 가져오기
git merge 로컬 저장소의 소스와 병합
git pull git fetch + get merge
버전 관리 git branch ~ 브랜치 생성
git checkout ~
git checkout -b ~ git branch + git checkout
git branch -d ~ 브랜치 삭제
git checkout master
git merge branch 브랜치 병합
git branch
git branch --no-merged
git branch --merged
브랜치 목록
태그 관리 git tag ~
git tag -a ~
태그 생성
git tag -d ~ 태그 삭제
git tag 태그 목록

참고 문헌