Git
델리마운트 위키
목차 |
설치
맥에서 git-core 설치
perl deactive라고 하면 아래 실행
$ sudo port uninstall perl5.8 #...
git server 설정
프로젝트 여러 개를 저장소 하나에 저장하기 vs. 프로젝트 하나를 저장소 하나에 저장하기
- 기준: 독립적 릴리즈인지, 공통의 이력관리가 필요한지에 따라 결정
설치 및 설정
git-core 설치
sudo apt-get install git-core
git 계정 만들기
sudo useradd -m -d /home/git -s /bin/bash -G delimount git
개발자 계정 만들기 및 설정
- 개발자계정 만들기
- sudo useradd -m -d /home/개발자아이디 -s /bin/bash -G delimount 개발자아이디
- sudo passwd 개발자아이디
- 그룹지정: 프로젝트 그룹에 개발자 지정
- sudo groupadd 프로젝트명
- sudo gpasswd -a 개발자아이디 프로젝트명
서버에 public repo를 생성하기
- 소스 폴더 생성
mkdir ~/프로젝트명
- public repo 폴더 생성
- sudo mkdir publi_repo_folder
- sudo chown deli:git public_repe_folder
- git clone --bare ~/프로젝트명/ public_repo_folder/프로젝트명.git
공동작업이 가능하도록 public repo 파일시스템의 권한 지정
- 파일시스템의 소유자와 그룹지정
chown -R deli:coupllog .
- others의 파일시스템의 접근 권한 배제
chmod -R o-rwx .
- groups의 파일시스템의 접근 권한 설정
chmod -R g+w .
- 모든 디렉토리에 SetGid 설정
find . -type d | xargs chmod g+s
로컬에서 public repo를 가져오기
git clone ssh://개발자아이디@서버주소/public_repo/프로젝트명.git
테스트
- 서버에 local repo를 push(commit)하기
git push origin master
- 서버에서 local repo로 pull(fetch&merge)하기
- git fetch -v
- git merge origin/master
또는 git pull origin/master
참조
- git server repository 환경 구성하기 - 중간중간 의미를 알 수 없는 명령들이 있는데, 무시하고 진행해도 문제 없었음
- Adding Empty Directories to a Git Repository
