mirror of
https://github.com/kossakovsky/n8n-install.git
synced 2026-03-07 14:23:08 +00:00
Enhance update script with git reset functionality
- Added a git reset --hard HEAD command to the update.sh script to ensure a clean working directory before pulling the latest changes. This helps prevent issues caused by uncommitted local changes during updates, while also logging a warning if the reset fails.
This commit is contained in:
@@ -36,6 +36,7 @@ if ! command -v git &> /dev/null; then
|
||||
else
|
||||
# Change to project root for git pull
|
||||
cd "$PROJECT_ROOT" || { log_error "Failed to change directory to $PROJECT_ROOT"; exit 1; }
|
||||
git reset --hard HEAD || { log_warning "Failed to reset repository. Continuing update with potentially unreset local changes..."; }
|
||||
git pull || { log_warning "Failed to pull latest repository changes. Continuing update with potentially old version of apply_update.sh..."; }
|
||||
# Change back to script dir or ensure apply_update.sh uses absolute paths or cd's itself
|
||||
# (apply_update.sh already handles cd to PROJECT_ROOT, so we're good)
|
||||
|
||||
Reference in New Issue
Block a user