cd C:\Users\dansa\Desktop\AI\MangaTranslator-Browser
# ตรวจสอบสถานะ
git status# ถ้ายังไม่มี .git folder
git init
# ตั้งค่า user (ครั้งแรก)
git config user.name "Your Name"
git config user.email "your.email@example.com"# Add ทุกไฟล์ (ยกเว้นที่อยู่ใน .gitignore)
git add .
# ดูว่า add อะไรบ้าง
git statusgit commit -m "Initial commit: Manga Translator Browser with Detection, OCR, and Multi-Page support"- เปิด https://github.com
- คลิก New Repository
- ตั้งชื่อ:
MangaTranslator-Browser - เลือก Public หรือ Private
- ไม่ต้อง เลือก Add README, .gitignore (เรามีแล้ว)
- คลิก Create Repository
# เพิ่ม remote repository (เปลี่ยน yourusername)
git remote add origin https://github.com/yourusername/MangaTranslator-Browser.git
# Push ขึ้น GitHub
git push -u origin main
# ถ้า Error ว่า branch ชื่อ master
git branch -M main
git push -u origin mainเปิด https://github.com/yourusername/MangaTranslator-Browser ควรเห็นไฟล์ทั้งหมดแล้ว!
# ดูว่ามีไฟล์อะไรเปลี่ยน
git status
# Add ไฟล์ที่แก้
git add .
# Commit
git commit -m "Add Settings Panel feature"
# Push
git pushgit log --oneline# สร้าง branch สำหรับ feature ใหม่
git checkout -b feature/new-feature
# แก้ไขโค้ด...
# Push branch ใหม่
git push -u origin feature/new-feature# Undo commit ล่าสุด (แต่เก็บการแก้ไข)
git reset --soft HEAD~1
# Undo ทุกอย่าง (ระวัง!)
git reset --hard HEAD~1-
ไฟล์ที่ไม่ควร commit:
node_modules/(ใหญ่มาก)venv/(Python virtual env).env(มี secrets)backend/uploads/(ไฟล์ผู้ใช้)backend/models/*.onnx(model ใหญ่)
-
ไฟล์เหล่านี้อยู่ใน
.gitignoreแล้ว ✅ -
Model file (detector.onnx):
- ถ้าต้องการแชร์ model ให้ user download แยก
- Or ใช้ Git LFS (Large File Storage)
-
Sensitive data:
- ตรวจสอบว่าไม่มี API keys, passwords ใน code
- ใช้
.envfile แทน (อยู่ใน .gitignore)
ถ้าต้องการ commit model file (.onnx):
# ติดตั้ง Git LFS
git lfs install
# Track ไฟล์ใหญ่
git lfs track "*.onnx"
# Add .gitattributes
git add .gitattributes
# Add model file
git add backend/models/detector.onnx
# Commit & Push
git commit -m "Add ONNX model with Git LFS"
git pushหมายเหตุ: GitHub Free มี LFS quota 1GB/month