# Kiểm tra trạng thái push
cd E:\opennotion

Write-Host "========================================" -ForegroundColor Cyan
Write-Host "  Kiểm tra trạng thái Git" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""

Write-Host "[1] Remote configuration:" -ForegroundColor Yellow
git remote -v
Write-Host ""

Write-Host "[2] Latest commit:" -ForegroundColor Yellow
git log --oneline -1
Write-Host ""

Write-Host "[3] Current branch:" -ForegroundColor Yellow
git branch --show-current
Write-Host ""

Write-Host "[4] Checking remote connection..." -ForegroundColor Yellow
$remoteCheck = git ls-remote --heads origin main 2>&1
if ($LASTEXITCODE -eq 0) {
    Write-Host "✓ Kết nối thành công với GitHub!" -ForegroundColor Green
    Write-Host "Remote branch info:" -ForegroundColor Cyan
    $remoteCheck
} else {
    Write-Host "✗ Không thể kết nối với remote" -ForegroundColor Red
    Write-Host $remoteCheck
}
Write-Host ""

Write-Host "[5] Local vs Remote:" -ForegroundColor Yellow
$localCommit = git rev-parse HEAD 2>$null
$remoteCommit = git rev-parse origin/main 2>$null

if ($localCommit -eq $remoteCommit) {
    Write-Host "✓ Code đã được push thành công!" -ForegroundColor Green
    Write-Host "Local và Remote đã đồng bộ" -ForegroundColor Green
} else {
    Write-Host "⚠ Local và Remote khác nhau" -ForegroundColor Yellow
    Write-Host "Local:  $localCommit" -ForegroundColor Cyan
    Write-Host "Remote: $remoteCommit" -ForegroundColor Cyan
}
Write-Host ""

Write-Host "Repository URL:" -ForegroundColor Cyan
Write-Host "https://github.com/Hoanganhvu123/cuccu_note" -ForegroundColor White

