Skip to content
Snippets Groups Projects
Commit 65a4c31a authored by Orhan-Timo Altan's avatar Orhan-Timo Altan
Browse files

Git Skript für Pull, Push und zum erstellen eines Branches

parent 9e416f6f
Branches
Tags v0.7.1
No related merge requests found
#!/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
#!/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
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment