- git-auth-guide-mac.md: Mac 전용 가이드 (Keychain 포함) - git-auth-guide-windows.md: Windows 전용 가이드 (Credential Manager, PowerShell 포함) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
6.2 KiB
6.2 KiB
Git 인증 설정 가이드 (Windows)
이 가이드는 git.nnotion.kr Gitea 서버에서 Personal Access Token(PAT)을 발급받고, Windows에서 설정하는 방법을 안내합니다.
목차
1. Personal Access Token 발급
1.1 토큰 생성 페이지 접속
브라우저에서 아래 주소로 이동:
https://git.nnotion.kr/user/settings/applications
또는 웹에서 수동으로 이동:
우측 상단 프로필 아이콘 → Settings → Applications
1.2 토큰 생성
- Token Name 입력:
my-blog-token(원하는 이름) - Select permissions 설정:
- ✅
repository→Read and Write체크
- ✅
- Generate Token 버튼 클릭
1.3 토큰 복사 (중요!)
⚠️ 주의: 토큰은 생성 직후 한 번만 표시됩니다!
- 생성된 토큰을 즉시 복사하여 안전한 곳에 저장
- 예시:
d262946c36480d23f57736dfe76b845706f513b0
2. 인증 설정
방법 A: Git Bash 사용 (권장)
2.1 Git Bash 열기
- 시작 메뉴 →
Git Bash검색 → 실행
2.2 호스트별 인증 설정
# git.nnotion.kr 전용 credential 설정
git config --global credential.https://git.nnotion.kr.helper store
# 인증정보 저장
echo "https://사용자명:토큰@git.nnotion.kr" >> ~/.git-credentials
예시 (사용자명: jobdori, 토큰: abc123...):
echo "https://jobdori:abc123token@git.nnotion.kr" >> ~/.git-credentials
방법 B: Windows Credential Manager 사용
2.1 Credential Manager 열기
Win + R→control입력 → 확인사용자 계정→자격 증명 관리자Windows 자격 증명탭 클릭
2.2 자격 증명 추가
일반 자격 증명 추가클릭- 정보 입력:
- 인터넷 또는 네트워크 주소:
git:https://git.nnotion.kr - 사용자 이름:
사용자명(예:jobdori) - 암호:
발급받은 토큰
- 인터넷 또는 네트워크 주소:
확인클릭
방법 C: PowerShell 사용
2.1 PowerShell 열기
- 시작 메뉴 →
PowerShell검색 → 실행
2.2 인증 설정
# credential helper 설정
git config --global credential.https://git.nnotion.kr.helper store
# 인증정보 저장
Add-Content -Path "$env:USERPROFILE\.git-credentials" -Value "https://사용자명:토큰@git.nnotion.kr"
방법 D: 프로젝트 폴더에서 직접 설정
# 프로젝트 폴더로 이동
cd C:\Users\사용자명\Desktop\my-blog
# 원격 URL에 인증정보 포함
git remote set-url origin https://사용자명:토큰@git.nnotion.kr/Clauders/Ex1-my-blog.git
3. 설정 확인
3.1 원격 저장소 확인
git remote -v
정상 출력:
origin https://git.nnotion.kr/Clauders/Ex1-my-blog.git (fetch)
origin https://git.nnotion.kr/Clauders/Ex1-my-blog.git (push)
3.2 Push 테스트
git push
성공 메시지:
Everything up-to-date
또는
To https://git.nnotion.kr/Clauders/Ex1-my-blog.git
abc1234..def5678 main -> main
3.3 Credential 설정 확인
Git Bash:
cat ~/.git-credentials
PowerShell:
Get-Content "$env:USERPROFILE\.git-credentials"
파일 위치:
C:\Users\사용자명\.git-credentials
3.4 Credential Manager 확인
Win + R→control→사용자 계정→자격 증명 관리자Windows 자격 증명탭git:https://git.nnotion.kr항목 확인
4. 문제 해결
문제: Authentication failed
원인: 토큰이 잘못되었거나 만료됨
해결:
# 기존 credential 삭제
git config --global --unset credential.helper
그리고 Credential Manager에서 삭제:
Win + R→control→사용자 계정→자격 증명 관리자Windows 자격 증명탭git:https://git.nnotion.kr항목 찾기제거클릭
다시 설정:
git config --global credential.https://git.nnotion.kr.helper store
문제: 다른 Git 서버와 충돌
원인: 전역 credential이 모든 서버에 적용됨
해결: 호스트별 credential 분리
# git.nnotion.kr 전용
git config --global credential.https://git.nnotion.kr.helper store
# github.com 전용 (필요시)
git config --global credential.https://github.com.helper manager
문제: remote: Repository not found
원인: 저장소 접근 권한 없음
해결:
- 토큰 권한 확인 (
repository: Read and Write) - 저장소 URL 확인
- 조직 멤버 권한 확인
문제: 토큰을 잊어버림
해결: 새 토큰 발급
- https://git.nnotion.kr/user/settings/applications 접속
- 기존 토큰 삭제 (Revoke)
- 새 토큰 생성
.git-credentials파일 수정 또는 재설정
문제: Git Bash가 설치되어 있지 않음
해결: Git for Windows 설치
- https://git-scm.com/download/win 접속
- 다운로드 및 설치
- 설치 시 "Git Bash Here" 옵션 체크
부록: 유용한 명령어
Git Bash:
# Git 설정 전체 확인
git config --list
# 특정 설정 확인
git config --global credential.helper
# credential 파일 위치
# C:\Users\사용자명\.git-credentials
# 원격 URL 변경
git remote set-url origin [새URL]
# 현재 브랜치 확인
git branch
# 푸시
git push -u origin main
PowerShell:
# Git 설정 확인
git config --list
# credential 파일 확인
Get-Content "$env:USERPROFILE\.git-credentials"
# credential 파일 열기 (메모장)
notepad "$env:USERPROFILE\.git-credentials"
요약
| 단계 | 명령어/작업 |
|---|---|
| 1. 토큰 발급 | Gitea 웹에서 생성 |
| 2. Git Bash 열기 | 시작 메뉴 → Git Bash |
| 3. Credential 설정 | git config --global credential.https://git.nnotion.kr.helper store |
| 4. 인증정보 저장 | echo "https://user:token@git.nnotion.kr" >> ~/.git-credentials |
| 5. Push 테스트 | git push |
문제가 있으면 이슈를 등록해주세요: https://git.nnotion.kr/Clauders/Ex1-my-blog/issues