✅ 1. Git 초기화
루트폴더 안에 들어와서 아래 명령어 실행.
git init
✅ 2. .gitignore 파일 생성 – 불필요한 파일 제외
vim .gitignore 또는 code .gitignore로 열어서
# OS 관련
.DS_Store
Thumbs.db
# IDE 관련
.vscode/
.idea/
# Python 예시
__pycache__/
*.pyc
venv/
# 기타 빌드 파일 등
node_modules/
dist/
✅ 3. README.md 먼저 작성
✅ 4. 커밋 준비 – 추적할 파일만 선택
git add README.md
git add .gitignore
✅ 5. 첫 커밋
git commit -m "Initial commit: README and .gitignore"
✅ 이후 단계
원하는 파일이나 디렉토리를 하나씩 git add 하고 커밋
git add src/main.py git commit -m "Add initial main script"
git status로 어떤 파일이 추적되고 있는지 확인하면서 진행하세요.
728x90
댓글