블로그 이미지
윤영식
Full Stacker, Application Architecter, KnowHow Dispenser and Bike Rider

Publication

Category

Recent Post

2012. 12. 24. 10:49 Git, GitHub/Git Lec02

Git 설치에 대해 간단히 알아보고, 설정하는 방법에 대하여 알아보자 


> Git 설치

  • Git은 curl, zlib, openssl, expat, libiconv를 필요로 한다 
// Fedora yum 이용
$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
$ yum install git-core

// 데비안 apt-get 이용
$ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
$ apt-get install git-core
// 윈도우 설치
http://code.google.com/p/msysgit  다운로드하여 설치한다

$ tar -zxf git-1.8.1.tar.gz

$ cd git-1.7.2.2
$ make prefix=/usr/local all
$ sudo make prefix=/usr/local install
  • Git이 이미 설치되었다면 최신버전 소스를 다음과 같이 받을 수 있다. 

git clone https://github.com/git/git.git



> Git 환경파일

  • /etc/gitconfig : 시스템의 모든 사용자와 모든 저장소에 적용되는 설정. git config --system 옵션으로 RW 가능.
  • ~/.gitconfig : 특정 사용자에게만 적용(윈도우는 USER 밑에 존재) git config --global 옵션으로 RW 가능.
  • .git/config : Git Directory(Local Repsoitory)의 현재 작업중인 프로젝트에만 적용. 우선순위 가장 높음.

// user 밑의 .gitconfig 파일 내역 

[user]

name = Yun DoWon

email = ysyun@yuwin.co.kr

[http]

postbuffer = 524288000

[push]

default = upstream

[core]

autocrlf = true

[color]

ui = auto


// 현재 프로젝트의 .git/config 파일 내역 

[core]

repositoryformatversion = 0

filemode = false

bare = false

logallrefupdates = true

symlinks = false

ignorecase = true

hideDotFiles = dotGitOnly

[remote "origin"]

url = https://github.com/ysyun/jmqtt_client.git

fetch = +refs/heads/*:refs/remotes/origin/*

[branch "master"]

remote = origin

merge = refs/heads/master


// 전체 설정 내역 보기 : git config {key} 명령으로 특정 Key에 대한 값 확인 (Help 명령: git help config)

$ git config --list

core.symlinks=false

core.autocrlf=true

color.diff=auto

color.status=auto

color.branch=auto

color.interactive=true

pack.packsizelimit=2g

help.format=html

http.sslcainfo=/bin/curl-ca-bundle.crt

sendemail.smtpserver=/bin/msmtp.exe

diff.astextplain.textconv=astextplain

rebase.autosquash=true

user.name=Yun DoWon

user.email=ysyun@yuwin.co.kr

http.postbuffer=524288000

push.default=upstream

core.autocrlf=true

color.ui=auto

core.repositoryformatversion=0

core.filemode=false

core.bare=false

core.logallrefupdates=true

core.symlinks=false

core.ignorecase=true

core.hidedotfiles=dotGitOnly

remote.origin.url=https://github.com/ysyun/jmqtt_client.git

remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

branch.master.remote=origin

branch.master.merge=refs/heads/master


posted by 윤영식