[git] git 설정하기

1. git 설치

sudo apt-get install build-dep git-core git-doc

2. git 구성하기
2.1. username과 email 설정

git config –global user.name “Yang Jeong-Seok”
git config –global user.email “dasomoli@gmail.com

2.2.. git 설정 확인

git config –global –list

2.3.. git color ui 사용

git config –global color.ui “auto”

2.4. 기본 인코딩을 cp949로 바꾸기

git config –global i18n.commitEncoding cp949
git config –global i18n.logOutputEncoding cp949

윈도에서는 LESSCHARSET=latin1 으로 설정해야 로그 메시지를 볼 수 있다.

set LESSCHARSET=latin1

2.5. 기본 에디터를 vim 으로 설정하기

git config –global core.editor “vim”

socat을 이용해서 gitproxy 사용하는 방법

* http://www.emilsit.net/blog/archives/how-to-use-the-git-protocol-through-a-http-connect-proxy/ 참고
* 아래 스크립트를 gitproxy라는 이름으로 저장함. 사용법은 아래 코멘트 참조. (socat 툴이 깔려 있어야 함 http://www.dest-unreach.org/socat/)


#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config –global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny

# Configuration. Common proxy ports are 3128, 8123, 8000.
_proxy=<IP:xxx.xxx.xxx.xxx>
_proxyport=<PORT:8080>


exec socat STDIO PROXY:$_proxy:$1:$2,proxyport=$_proxyport

corkscrew 를 이용해서 git proxy 이용하기

1. corkscrew 를 다운로드 및 설치(우분투는 그냥 apt-get install corkscrew)
1.1. http://www.agroman.net/corkscrew/ 에서 구할 수 있다. wget을 이용하여 다운로드.

1.2. 설치

# configure; make; make install

1.3. /usr/local/bin/corkscrew 가 설치되었음을 확인.

2. git proxy를 위한 스크립트 작성
2.1. /usr/local/bin/gitproxy.sh 작성

#!/bin/bash
/usr/local/bin/corkscrew <Proxy IP> <Port> $*

2.2. ~/.bashrc 에 다음 추가

$ export GIT_PROXY_COMMAND=/usr/local/bin/gitproxy.sh

참고 : http://cafe.naver.com/embeddedcrazyboys.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=4981

분산형 SCM(Software Configuration Management) 관심이 간다.

 Subversion을 열심히 애용 중이던 나. KLDP의 “Perl도 git으로 전환…” 이란 글을 보고 Git란 것에 관심이 생기긴 시작했다. 리누즈가 만든 분산형 SCM 이란 이야기는 예전부터 들었으나 아직 사용해보지 않아 어떤지 잘 모르겠지만 Painless merging이 가능하다는 이야기에 매우 관심이 간다.
 SVN으로 프로젝트 관리시에 branch한 트리에서의 Merge작업이나 한 트리의 작업내용을 다른 트리에 반영하기 꽤나 까다로웠던 것으로 생각되어 더 더욱 그렇다.
 예전 과제시에 사용했던 Mercurial 역시 분산형 SCM으로 이 역시 많이 사용되는 것 같다. Subversion도 좋지만, 그 단점을 보완할 수 있는 툴이 있다면(TortoiseSVN과 같은 GUI Frontend가 존재한다는 것이 상당한 장점이지만) 역시 고려해보는 것이 좋겠다. Mercurial로 관리되던 소스 트리를 실제 과제시에는 익숙한 SVN을 사용했었기에 안타까웠던 마음도 이에 영향을 미치는 것 같다. ㅎㅎ
 Mercurial에 관해서는 우리먈로 된 친절한 튜토리얼(Mercurial 사용 입문서)이 존재하고(과제시에 도움을 많이 받았다^^), Git에 관해서도 충분한 도움말이 있는 듯 보인다.
 여러 SCM 들에 대한 간단한 설명과 사용법은 IBM DeveloperWorks의 리눅스 버전 컨트롤 (한글) 글이 도움이 될 것 같다. 말미에 Git 에 대한 사용법도 약간 나온다. 실제 사용을 위한 무언가를 준비해보아야 겠다. TortoiseSVN과 같은 GUI frontend가 있다면 더할 나위 없이 좋겠다. ^^