From 474d2d9f62a67f1ed2862fcf71be733270a58ecc Mon Sep 17 00:00:00 2001 From: silvernode Date: Fri, 29 Jan 2016 05:12:16 -0700 Subject: [PATCH] initial commit --- Bash Scripts/git_config.sh | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 Bash Scripts/git_config.sh diff --git a/Bash Scripts/git_config.sh b/Bash Scripts/git_config.sh new file mode 100755 index 0000000..a838553 --- /dev/null +++ b/Bash Scripts/git_config.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +echo " ===============" +echo "| Git Config |" +echo " ===============" +echo +echo -n "Global config or local? (g/l): " +read location +echo +echo "The following will be displayed in your commits..." +echo -n "E-mail Address: " +read email +echo -n "Username: " +read name +echo +if [ "${location}" = "g" ];then + echo "Review for global config:" + echo + echo "Email Address: ${email}" + echo "Username: ${name}" + echo + echo -n "Are these settings correct? (y/n): " + read confirm + + if [ "${confirm}" = "n" ];then + echo + echo "Setup Cancelled...re-run to start over" + exit 0; + else + git config --global user.email ${email} + git config --global user.name ${name} + echo + echo "Saved global config" + exit 0; + fi +elif [ "${location}" = "l" ];then + echo "Review for local config:" + echo + echo "Email Address: ${email}" + echo "Username: ${name}" + echo + echo -n "Are these settings correct? (y/n): " + read confirm + + if [ "${confirm}" = "n" ];then + echo + echo "Setup Cancelled...re-run to start over" + exit 0; + else + git config user.email ${email} + git config user.name ${name} + echo + echo "Saved local config" + exit 0; + fi +fi