-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-push.sh
More file actions
executable file
·31 lines (25 loc) · 892 Bytes
/
git-push.sh
File metadata and controls
executable file
·31 lines (25 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Ask inputs
read -p "Enter target branch (default: pepsi_dev): " target_branch
read -p "Enter feature branch: " feature_branch
read -p "Enter MR title: " mr_title
read -p "Enter MR description: " mr_desc
# If target branch empty, fallback to pepsi_dev
target_branch=${target_branch:-pepsi_dev}
echo ""
echo "You are about to push with the following details:"
echo " Target branch : $target_branch"
echo " Feature branch : $feature_branch"
echo " MR Title : $mr_title"
echo " MR Description : $mr_desc"
echo ""
read -p "Do you want to continue? (y/N): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
git push -o merge_request.create \
-o merge_request.target="$target_branch" \
-o merge_request.title="$mr_title" \
-o merge_request.description="$mr_desc" \
origin "$feature_branch"
else
echo "Push cancelled."
fi