Files
ShiftRing/docs/gitlab-wiki-guide.md
2026-02-22 14:30:22 +09:00

1.9 KiB

GitLab Wiki 설정 가이드

개요

GitLab Wiki는 저장소와 별도로 관리되며, 마크다운 파일로 작성합니다.

시작하기

1. Wiki 저장소 클론

git clone git@git.webpluss.net:username/project.wiki.git
cd project.wiki

2. 마크다운 파일 작성

touch my-page.md
# 마크다운 작성 후
git add .
git commit -m "Add wiki page"
git push

SSH 키 설정 (권장)

1. SSH 키 생성 (없는 경우)

ssh-keygen -t ed25519 -C "your_email@example.com"

2. GitLab에 SSH 키 추가

  • GitLab → Settings → SSH Keys
  • ~/.ssh/id_ed25519.pub 내용 복사해서 추가

3. remote 설정

git remote set-url origin git@git.webpluss.net:username/project.git

HTTPS 사용 시 (토큰 방식)

1. Personal Access Token 생성

  • GitLab → Settings → Access Tokens
  • 이름: git_push
  • 스코프: api
  • 만료일: 적절히 설정

2. 토큰으로 푸시

git remote set-url origin https://username:TOKEN@git.webpluss.net/username/project.git
git push -u origin main

3. 토큰 숨기기 (보안)

# URL에서 토큰 제거
git remote set-url origin https://username@git.webpluss.net/username/project.git

# credential.helper로 토큰 저장
git config credential.helper store

# 이후 푸시 시 토큰 자동 입력됨
git push

저장소 내 문서 폴더 방식

Wiki 저장소 접근이 어려운 경우, docs/ 폴더를 사용할 수 있습니다.

mkdir docs
echo "# 프로젝트 문서" > docs/home.md
git add docs/
git commit -m "Add documentation"
git push

마크다운 문법

# 제목
## 부제목

- 목록 项
- [링크](url)

**굵게** *기울임*

코드:
```javascript
console.log('hello');

## 참고

- GitLab Wiki는 `.md` 파일만 지원
- 파일명이 페이지 URL이 됨 (home.md → /home)
- 사이드바는 GitLab이 자동으로 생성