diff --git a/Create-Git-Branch.sh b/Create-Git-Branch.sh new file mode 100644 index 0000000000000000000000000000000000000000..2e01a43f389c0c3b8c0c158a54678f6d5193655f --- /dev/null +++ b/Create-Git-Branch.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +read -p $'\e[32mPlease insert a Branch name: \e[0m' branch_name + +read -p $'\e[32mIs this branch name correct?[y/n] \e[0m' correct + +if [ "$correct" == "y" ] + then + git checkout -b $branch_name + git push origin $branch_name + elif [ "$correct" == "n" ] + then + read -p $'\e[36mPlease insert correct Branch name: \e[0m' branch_name + git checkout -b $branch_name + git push origin $branch_name + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' +fi + +read -p "Press enter to continue " \ No newline at end of file diff --git a/Git-Befehle.sh b/Git-Befehle.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8406d339bf2ebd8a3355bb341098a65cd3dd686 --- /dev/null +++ b/Git-Befehle.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +read -p $'\e[32mDo you want to create a branch, pull files or push files?[branch/pull/push] \e[0m' which_command + +if [ "$which_command" == "branch" ] + then + read -p $'\e[32mPlease insert a Branch name: \e[0m' branch_name + + read -p $'\e[32mIs this branch name correct?[y/n] \e[0m' correct + + if [ "$correct" == "y" ] + then + git checkout -b $branch_name + git push origin $branch_name + elif [ "$correct" == "n" ] + then + read -p $'\e[36mPlease insert correct Branch name: \e[0m' branch_name + git checkout -b $branch_name + git push origin $branch_name + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' + fi + elif [ "$which_command" == "pull" ] + then + read -p $'\e[32mPlease insert the Git-Repository address: \e[0m' git_link + + read -p $'\e[32mIs this address correct?[y/n] \e[0m' correct + + if [ "$correct" == "y" ] + then + read -p $'\e[32mWhat is the branch name? \e[0m' branch_name + + read -p $'\e[32mIs this branch name correct?[y/n] \e[0m' correct_branch + + if [ "$correct_branch" == "y" ] + then + git pull $git_link $branch_name + elif [ "$correct_branch" == "n" ] + then + read -p $'\e[36mPlease insert correct branch name \e[0m' branch_name + git pull $git_link $branch_name + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' + fi + elif [ "$correct" == "n" ] + then + echo $'\e[31mTry executing this Script again! \e[0m' + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' + fi + elif [ "$which_command" == "push" ] + then + echo "Adding changed files to the index" + + git add . + + read -p $'\e[32mPlease insert a comment for this commit:\e[0m ' comment_commit + + read -p $'\e[32mIs this comment correct?[y/n]\e[0m ' correct + + if [ "$correct" == "y" ] + then + git commit -m "$comment_commit" + + read -p $'\e[32mWhat is the branch name? \e[0m' branch_name + + read -p $'\e[32mIs this branch name correct?[y/n] \e[0m' correct_branch + + if [ "$correct_branch" == "y" ] + then + git push origin $branch_name + elif [ "$correct_branch" == "n" ] + then + read -p $'\e[36mPlease insert correct branch name \e[0m' branch_name + git push origin $branch_name + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' + fi + elif [ "$correct" == "n" ] + then + echo $'\e[31mTry executing this Script again!\e[0m' + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' + fi +fi + +read -p "Press enter to continue " \ No newline at end of file diff --git a/Git-Befehle_Skripte.zip b/Git-Befehle_Skripte.zip deleted file mode 100644 index 7809629fe9ff8642922f56285b2fe3d562a415bf..0000000000000000000000000000000000000000 Binary files a/Git-Befehle_Skripte.zip and /dev/null differ diff --git a/Git-Pull.sh b/Git-Pull.sh new file mode 100644 index 0000000000000000000000000000000000000000..8d193a1657f218da750ea5a46cd9b8fb03e3cdb1 --- /dev/null +++ b/Git-Pull.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +read -p $'\e[32mPlease insert the Git-Repository address: \e[0m' git_link + +read -p $'\e[32mIs this address correct?[y/n] \e[0m' correct + +if [ "$correct" == "y" ] + then + read -p $'\e[32mWhat is the branch name? \e[0m' branch_name + + read -p $'\e[32mIs this branch name correct?[y/n] \e[0m' correct_branch + + if [ "$correct_branch" == "y" ] + then + git pull $git_link $branch_name + elif [ "$correct_branch" == "n" ] + then + read -p $'\e[36mPlease insert correct branch name \e[0m' branch_name + git pull $git_link $branch_name + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' + fi + elif [ "$correct" == "n" ] + then + echo $'\e[31mTry executing this Script again! \e[0m' + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' +fi + +read -p "Press enter to continue " \ No newline at end of file diff --git a/Git-Push.sh b/Git-Push.sh new file mode 100644 index 0000000000000000000000000000000000000000..be60ba2233a437fa976da483800c250e4045cd57 --- /dev/null +++ b/Git-Push.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +echo "Adding changed files to the index" + +git add . + +read -p $'\e[32mPlease insert a comment for this commit:\e[0m ' comment_commit + +read -p $'\e[32mIs this comment correct?[y/n]\e[0m ' correct + +if [ "$correct" == "y" ] + then + git commit -m "$comment_commit" + + read -p $'\e[32mWhat is the branch name? \e[0m' branch_name + + read -p $'\e[32mIs this branch name correct?[y/n] \e[0m' correct_branch + + if [ "$correct_branch" == "y" ] + then + git push origin $branch_name + elif [ "$correct_branch" == "n" ] + then + read -p $'\e[36mPlease insert correct branch name \e[0m' branch_name + git push origin $branch_name + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' + fi + elif [ "$correct" == "n" ] + then + echo $'\e[31mTry executing this Script again!\e[0m' + else + echo $'\e[31mWrong input! Please type y (yes) or n (no) \e[0m' +fi + +read -p "Press enter to continue " \ No newline at end of file