[GitLab] 개인 저장소 연동 테스트

지난 포스트 Docker를 이용해 GitLab을 설치해보자로 GitLab을 설치한 후 정말 제대로 동작하는지 궁금해졌습니다.
이번 포스트에서는 저장소를 직접 생성해보고 연동 테스트를 해볼거예요.

저장소 생성

GitLab에 로그인 후 [Create a project]를 클릭합니다.

프로젝트 이름을 적고 생성을 눌러줍니다.

정상적으로 생성되었네요.
빨간 박스를 참고해 아래의 스텝에서 저장소를 복제하도록 합니다.

저장소 복제

1
2
3
4
5
6
7
 % git clone http://xxx.xxx.xxx.xxx/devsawd/hello-world.git

Cloning into 'hello-world'...
Username for 'http://xxx.xxx.xxx.xxx': devsawd@gmail.com
Password for 'http://devsawd@gmail.com@xxx.xxx.xxx.xxx':
warning: You appear to have cloned an empty repository.
% cd hello-world

빈 프로젝트를 복제한것이기 때문에 warning이 뜨니 가볍게 무시해줍니다.

README.md 파일 생성

1
% touch README.md

Commit and Push

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
hello-world % git add README.md
hello-world % git commit -m "add README"
[master (root-commit) 204db60] add README
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md

hello-world % git push -u origin master
Username for 'http://xxx.xxx.xxx.xxx': devsawd@gmail.com
Password for 'http://devsawd@gmail.com@xxx.xxx.xxx.xxx':
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 212 bytes | 212.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://xxx.xxx.xxx.xxx/devsawd/hello-world.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

결과

정상적으로 파일이 올라간것이 보입니다!
이제 집 밖의 어디에서든 개인 GitLab에 접근해서 사용할 수 있게 되었습니다.

다음에는 이 hello-world 프로젝트를 백업하고 GitLab Docker를 삭제하고 재구동했을때 복구가 되는지 확인해볼거예요.