]> gitweb.fluxo.info Git - utils-git.git/commitdiff
Adds git-update-superproject
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 27 Nov 2017 11:20:31 +0000 (09:20 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 27 Nov 2017 11:20:31 +0000 (09:20 -0200)
git-update-superproject [new file with mode: 0755]

diff --git a/git-update-superproject b/git-update-superproject
new file mode 100755 (executable)
index 0000000..d58d416
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Updates a superproject
+#
+
+# Parameters
+BASENAME="`basename $0`"
+
+# Check
+if [ ! -e ".git" ]; then
+  echo "$BASENAME: not a git repository"
+  exit 1
+fi
+
+# Run
+git pull $*
+git submodule sync   --recursive
+git submodule update --recursive --init
+git submodules-checkout-branch