From a8a93d7b05fb7a926eb75761676a8203be05653d Mon Sep 17 00:00:00 2001 From: phized3lit Date: Tue, 16 Dec 2025 11:04:50 +0000 Subject: [PATCH] =?UTF-8?q?Git=20=EC=82=AC=EC=9A=A9=20=EA=B0=80=EC=9D=B4?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d987db..c55ef3e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,127 @@ -# git-guide +# Git 서버 사용 가이드 (최초 시작용) +이 문서는 **사내 / 개인 Git 서버(Gitea)**를 처음 사용하는 사용자를 위한 최소 사용 가이드입니다. +아래 순서대로 진행하면 바로 프로젝트 관리를 시작할 수 있습니다. + +--- + +## 1. Git 설치 + +- **Windows**: Git Bash 설치 +- **macOS / Linux**: 기본 Git 사용 + +설치 확인: +```bash +git --version +``` + +--- + +## 2. 최초 1회 사용자 정보 설정 (PC마다 1번) + +```bash +git config --global user.name "이름" +git config --global user.email "이메일" +``` + +--- + +## 3. SSH 키 생성 (최초 1회) + +```bash +ssh-keygen -t ed25519 +``` + +엔터를 계속 누르면 기본 경로로 생성됩니다. + +공개키 확인: +```bash +cat ~/.ssh/id_ed25519.pub +``` + +출력된 내용을 복사해서 +**Gitea 웹 → 사용자 설정 → SSH Keys** 에 등록하세요. + +--- + +## 4. SSH 연결 테스트 + +```bash +ssh -p 2222 git@git.phized3lit.duckdns.org +``` + +아래 메시지가 나오면 정상입니다. +``` +Welcome to Gitea +``` + +--- + +## 5. 새 프로젝트를 서버에 올리기 (처음 1회) + +```bash +cd 프로젝트폴더 +git init +git add . +git commit -m "initial commit" +git branch -M main +git remote add origin ssh://git@git.phized3lit.duckdns.org:2222/아이디/리포지토리명.git +git push -u origin main +``` + +--- + +## 6. 기존 프로젝트 내려받기 + +```bash +git clone ssh://git@git.phized3lit.duckdns.org:2222/아이디/리포지토리명.git +``` + +--- + +## 7. 평소 작업 방법 + +```bash +git status +git add . +git commit -m "작업 내용" +git push +``` + +--- + +## 8. 서버 최신 내용 받기 + +```bash +git pull +``` + +--- + +## 9. 대용량 파일 사용 (선택) + +```bash +git lfs install +git lfs track "*.zip" +git add .gitattributes +git add 큰파일.zip +git commit -m "add large file" +git push +``` + +--- + +## 서버 정보 + +- Git 서버 주소: `git.phized3lit.duckdns.org` +- SSH 포트: `2222` +- 웹 접속 주소: https://git.phized3lit.duckdns.org + +--- + +## 요약 + +- 최초에는 **SSH 키 등록만 하면 끝** +- 이후에는 `add → commit → push`만 반복 +- 여러 PC에서도 동일하게 사용 가능 +- 대용량 파일은 Git LFS 사용