[설치환경]
– OS : 7.3.1611
– Eclipse mars(4.5.2, 전자 정부 프레임 워크 3.6.0)
[Git 설치]
– 순서
1. yum –y update
2. yum –y install git
– 설치 확인 : git version
[계정 생성]
– adduser git
– passwd git
[key 생성]
– su – git
– cd ~
– ssh-keygen -t rsa
[bare repository 생성]
– repository로 사용할 directory 생성.
> su root
> mkdir <git repository directory name>
> chown git <git repository directory name>
> chmod 755 <git repository directory name>
> su git
> cd <git repository directory name>
> git init –bare <project name>.git
[git user 생성]
– git config –global user.name “<user name>”
– git config –global user.email “<email>”
[서버 test]
– cd ~
– mkdir <project name>
– cd <project name>
– git init
– git commit -m “<commit message>” -a
[eclipse 설정]
– git repository 추가.






[ssh 접속]
– command로 clone시 password 입력을 하지 않기 위해서는 공개키를 생성하여 git server에 등록 해주어야 한다.
> git clone ssh://git@<git server ip>/<git repository directory>/<git project>.git <clone이 발생할 local directory path>

– ssh key 생성.
> git 설치 ( https://git-scm.com/downloads )
> git bash 실행
> ssh-keygen 실행
>>사용자/.ssh folder에 생성됨.( id_rsa, id_rsa.pub )


– id_rsa.pub를 서버로 전송.( ※git user home directory의 .ssh directory로 이동시킨다.)
(/home/git/.ssh)

– authorized_key file 생성
> cd /home/git/.ssh
> cat id_rsa.pub >> authorized_keys
– authorized_key file 권한 변경
> su root
> chmod 700 authorized_keys ( 권한 변경을 해주지 않으면 password 입력 prompt가 발생 한다. )
