From 4615f9c27d711fb8ffdc0ae44a6ddabbcca0c5f4 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 10 Apr 2018 11:03:15 +0200 Subject: [PATCH] Add hard_reset (git) --- dev/hard_reset.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 dev/hard_reset.sh diff --git a/dev/hard_reset.sh b/dev/hard_reset.sh new file mode 100755 index 0000000..a099f17 --- /dev/null +++ b/dev/hard_reset.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# The script detect the right main project branch, then update the submodule function of branch-[mainProjectBranch] +# For example, if you define these variables in .gitmodules : +# - branch-dev +# - branch-master +# If you are on dev branch in main project, the script will update submodule functions of branch-dev you've defined +# In main project, if you are in another branch than master or dev, it will take by default dev branch +# If you don't define any branches for you submodule, the script will update from master + +cd "$(dirname "$0")"/../../ + +git reset --hard +git submodule foreach --recursive 'git reset --hard' -- 2.39.5