From 2092c6d01a0e6e5fe3ddca404e280715691d2961 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 6 Sep 2016 12:24:56 -0400 Subject: [PATCH] Reset submodules before updating them to prevent merge conflicts on local changes to updated files --- update | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update b/update index fc445ec..87886a6 100755 --- a/update +++ b/update @@ -62,7 +62,7 @@ function show_help { } ### SETUP -cd "$script_home" +cd "$script_home" || exit # delete old error log if it exists [[ -f "$error_log" ]] \ @@ -152,6 +152,7 @@ fi # update each submodule to the new head and run 'git fetch --all' printf '%s' "$cbg_blue $c_reset$cbg_yellow + Fetching updates:$c_reset" +git submodule foreach git reset --hard >/dev/null 2>&1 process_status="$(git submodule foreach git fetch --all 2>&1)" if (( ! $? )); then process_status=$(git submodule update --init --recursive 2>&1)