Fix deploy.sh: uncomment git pull so server gets latest code on deploy

Previously the git fetch/reset block was commented out and the script only
deployed whatever was already in the repo dir. Uncommented it and added
git config core.fileMode false to prevent permission-drift merge conflicts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-03-13 15:00:21 +00:00
parent e60639c58d
commit fdd63482f6

View file

@ -70,21 +70,18 @@ else
fi
# ── Pull Latest Code ─────────────────────────────────────────────
# Run `git pull` manually before running this script.
# log "Pulling latest code..."
# cd "${REPO_DIR}"
#
# if [ -d .git ]; then
# git fetch --all
# git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)
# log "Code updated to $(git log --oneline -1)"
# else
# warn "Not a git repo — using existing files"
# fi
log "Pulling latest code..."
cd "${REPO_DIR}"
log "Using current code at $(git log --oneline -1 2>/dev/null || echo 'unknown')"
if [ -d .git ]; then
git config core.fileMode false
git fetch --all
git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)
log "Code updated to $(git log --oneline -1)"
else
warn "Not a git repo — using existing files"
fi
# ── Environment File ─────────────────────────────────────────────