새 저장소로 블로그 옮기기 (theme fork 의존 줄이기)

아래 순서대로 하면 minimal-mistakes 전체 포크를 계속 들고 가지 않고, 콘텐츠 중심 repo로 깔끔하게 분리할 수 있습니다.

1) 새 GitHub repo 생성

2) 최소 파일만 복사

현재 repo에서 아래만 새 repo로 복사하세요.

_layouts, _includes, _sass 전체를 직접 들고 가지 않으면 테마 업그레이드가 쉬워집니다.

3) 테마를 remote_theme 로 전환

_config.yml에서 아래처럼 설정하세요.

remote_theme: "mmistakes/minimal-mistakes"
plugins:
  - jekyll-include-cache
  - jekyll-paginate
  - jekyll-sitemap
  - jekyll-gist
  - jekyll-feed

4) GitHub Pages 배포 확인

5) 내부 페이지 스타일 유지 포인트

이번에 적용한 스타일은 assets/css/main.scss 하나에 모여 있으므로, 새 repo로 옮겨도 동일하게 적용됩니다.

선택 옵션: 내가 바로 옮겨줄 수 있는 범위

이 작업 환경에서는 네 GitHub 계정에 직접 push/생성 권한이 없어서 원격 저장소를 “대신 생성” 하지는 못합니다.

대신 아래는 바로 해줄 수 있습니다.

빠른 명령 템플릿

아래는 로컬에서 새 repo로 연결할 때 쓰는 예시입니다.

git remote rename origin old-origin
git remote add origin https://github.com/<YOUR_ID>/panwoo1.github.io.git
git push -u origin <YOUR_BRANCH>

repo 이름을 panwoo1.github.io / panwoo1.github.io2 로 쓴 경우

GitHub Pages 사용자 사이트는 정확히 panwoo1.github.io 이름의 repo가 메인 주소(https://panwoo1.github.io)를 가집니다.

설정 체크

새 메인 repo(panwoo1.github.io)의 _config.yml:

url: "https://panwoo1.github.io"
baseurl: ""

기존 보조 repo(panwoo1.github.io2)를 계속 페이지로 띄울 경우 _config.yml:

url: "https://panwoo1.github.io"
baseurl: "/panwoo1.github.io2"

권장

현재 계획 확정: panwoo1.github.io2 -> panwoo1.github.io 로 이전 후 github.io2 삭제

맞습니다. 지금 사용하는 소스 repo(panwoo1.github.io2)에서 복사해서 새 메인 repo(panwoo1.github.io)로 넘긴 뒤, 안정화 확인 후 github.io2를 정리하는 플로우가 맞습니다.

실행 순서(정확 버전)

  1. 새 메인 repo clone
    git clone https://github.com/panwoo1/panwoo1.github.io.git ~/work/panwoo1.github.io
    
  2. 현재 작업 중인 repo(panwoo1.github.io2) 루트에서 복사 스크립트 실행
    ./scripts/copy-to-new-repo.sh ~/work/panwoo1.github.io
    
  3. 새 repo로 이동해서 _config.yml 확인
    • url: "https://panwoo1.github.io"
    • baseurl: ""
  4. 새 repo 커밋/푸시
    cd ~/work/panwoo1.github.io
    git add .
    git commit -m "Migrate site content from panwoo1.github.io2"
    git push origin main
    
  5. 배포 확인 후 panwoo1.github.io2 비활성/삭제
    • GitHub Pages 정상 반영 확인 뒤 진행

주의