써리원의 이것저것

PC 디렉토리에 GIT 백업데이터 연동 방법 (SourceTree) 본문

서버관련

PC 디렉토리에 GIT 백업데이터 연동 방법 (SourceTree)

써리_원 2018. 6. 22. 17:09

1. GitLab 에서 new project 생성

-> Project path http://192.168.xxx.xxx:8081/userid/

-> Visibility Level Internal


2. GitLab 에서 adding README 링크 클릭하여 테스트파일 생성


3. 로컬PC 에서 Git 서버와 연결할 폴더를 생성

-> D:\server_git\projectName


4. SourceTree 에서 저장소 복제/추가/생성

-> GitLab 에서 생성한 프로젝트의 https값을 설정

     : 소스경로 / URL : http://192.168.xxx.xxx:8081/userid/projectName.git

     : 목적지경로 : D:\server_git\projectName


5. GitLab 에서 readme 파일 삭제, SourceTree 에서 풀 테스트, 로컬 폴더에 파일 삭제 확인


6. 로컬 폴더에 Git 서버로 보낼 파일 복사


7. SourceTree 에서 커밋 > 푸시


8. 별도 서버의 공간에 서비스(또는 백업) 용도의 폴더를 생성

-> mkdir /home/projectName


9. /home/ 디렉토리에서 git clone git@192.168.xxx.xxx:userid/projectName.git


10. vi /home/projectName/pull_projectName.sh (chmod 755 pull_projectName.sh)

-> cd /home/projectName/

-> git pull origin


11. Git 서버의 hook 디렉토리에 post-update (chmod 755) 생성 또는 수정

-> cd /var/opt/gitlab/git-data/repositories/shwon/projectName.git/hooks

-> vi post-update

-> ssh root@192.168.xxx.xxx "/home/projectName/pull_projectName.sh"


12. 로컬PC 에서 test.html 파일 생성, 커밋, 푸시 -> 서버의 /home/projectName/test.html 파일 생성 확인



'서버관련' 카테고리의 다른 글

Sendmail Queue 확인  (0) 2018.07.10
HeidiSQL mysql 외부연결  (0) 2018.06.22
centos + mariadb + GitLab + redmine + php70 설치  (0) 2018.06.22
AWS 리눅스 설치  (0) 2018.06.22
리눅스 계정 생성  (0) 2018.06.22
Comments