1.5 KiB
1.5 KiB
Resolve Merge Conflict di Server Production
Langkah-langkah:
1. Cek Status Git
cd /www/wwwroot/retribusi.btekno.cloud/retribusi
git status
2. Lihat File yang Conflict
git diff
3. Resolve Conflict
Opsi 1: Keep Local Changes (jika ada perubahan lokal yang penting)
# Lihat file yang conflict
git status
# Untuk setiap file yang conflict, pilih salah satu:
# - Keep local: git checkout --ours <file>
# - Keep remote: git checkout --theirs <file>
# - Manual edit: edit file, lalu git add <file>
Opsi 2: Discard Local Changes (Recommended - gunakan versi dari repo)
# Reset semua perubahan lokal
git reset --hard HEAD
# Pull lagi
git pull origin main
Opsi 3: Stash Local Changes (simpan perubahan lokal untuk nanti)
# Stash perubahan lokal
git stash
# Pull update
git pull origin main
# Jika perlu, restore perubahan lokal
git stash pop
4. Setelah Resolve, Commit
# Jika ada file yang di-edit manual
git add .
git commit -m "Resolve merge conflict"
# Atau jika menggunakan reset/stash, langsung pull
git pull origin main
5. Verify
git status
# Seharusnya: "Your branch is up to date with 'origin/main'"
Quick Fix (Recommended)
Jika tidak ada perubahan lokal yang penting:
cd /www/wwwroot/retribusi.btekno.cloud/retribusi
git reset --hard HEAD
git pull origin main
Ini akan:
- Discard semua perubahan lokal
- Pull update terbaru dari repository
- Pastikan server sama dengan repository