From 1468f8522909f9601ca81cae9a47615abc0f4394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lecour?= Date: Fri, 14 Jul 2017 11:41:49 +0200 Subject: [PATCH] Script to move a role in a feature branch --- tools/move_role_to_feature_branch.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 tools/move_role_to_feature_branch.sh diff --git a/tools/move_role_to_feature_branch.sh b/tools/move_role_to_feature_branch.sh new file mode 100755 index 0000000..8de5734 --- /dev/null +++ b/tools/move_role_to_feature_branch.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +readonly role=$1 +readonly current_branch=`git branch | grep '\*' | awk '{print $2}'` + +echo "role: $role" +echo "current_branch: $current_branch" + +# echo "Ctrl-C to cancel" +# sleep 3 + +git rm -r --cached --quiet $role +git commit -m "More $role to a feature branch" +git checkout -b $role +git add $role +git commit -m "[WIP] $role role" +git push --set-upstream origin $role +git checkout $current_branch