26 lines
678 B
Bash
26 lines
678 B
Bash
#!/bin/bash
|
|
|
|
# Prompt for confirmation
|
|
echo "Are you sure you want to merge 'development' into 'production'? (y/n)"
|
|
read -r confirmation
|
|
|
|
if [[ "$confirmation" == "y" || "$confirmation" == "Y" ]]; then
|
|
# Switch to the production branch
|
|
git checkout production
|
|
|
|
# Pull the latest changes for production
|
|
git pull origin production
|
|
|
|
# Merge the development branch into production
|
|
git merge development
|
|
|
|
# Check if the merge was successful
|
|
if [ $? -eq 0 ]; then
|
|
echo "Merge successful. Please resolve any conflicts and commit."
|
|
else
|
|
echo "Merge failed. Please resolve conflicts manually."
|
|
fi
|
|
else
|
|
echo "Merge aborted."
|
|
fi
|