Skip to content

Latest commit

 

History

History
107 lines (85 loc) · 1.91 KB

File metadata and controls

107 lines (85 loc) · 1.91 KB

Hướng dẫn Update Dự án lên GitHub

Cách 1: Sử dụng Script (Khuyến nghị)

Windows (PowerShell):

.\update_github.ps1 "Your commit message"

Linux/Mac (Bash):

chmod +x update_github.sh
./update_github.sh "Your commit message"

Cách 2: Sử dụng Git Commands thủ công

1. Kiểm tra trạng thái:

git status

2. Thêm tất cả các file:

git add .

3. Commit với message:

git commit -m "Update portfolio website with new features"

4. Push lên GitHub:

git push origin main

Nếu lần đầu push:

git push -u origin main

Cách 3: Quick Commands (Copy & Paste)

Windows PowerShell:

git add .
git commit -m "Update portfolio website"
git push origin main

Linux/Mac:

git add .
git commit -m "Update portfolio website"
git push origin main

Lưu ý:

  1. Đảm bảo .gitignore đã được cập nhật để không commit các file không cần thiết:

    • .venv/ (virtual environment)
    • *.db (database files)
    • __pycache__/ (Python cache)
    • .env (environment variables)
  2. Kiểm tra file trước khi commit:

    git status
  3. Xem các thay đổi:

    git diff
  4. Nếu có conflict:

    git pull origin main
    # Resolve conflicts
    git add .
    git commit -m "Resolve conflicts"
    git push origin main

Troubleshooting:

Lỗi: "fatal: not a git repository"

git init
git remote add origin <your-github-repo-url>

Lỗi: "Updates were rejected"

git pull origin main --rebase
git push origin main

Lỗi: "Permission denied"

  • Kiểm tra SSH keys hoặc Personal Access Token
  • Cấu hình git credentials:
    git config --global user.name "Your Name"
    git config --global user.email "your.email@example.com"