3. Make the Script Executable:
sudo chmod +x git_commit_push.sh
4. Navigate to your project directory.
5. Run `~/git_commit_push.sh [branch_name] "commit_message"`.
Give it a try and experience the seamless Git workflow! Your feedback is invaluable. Happy coding! 💻🚀
# Add all changes to the staging area
git add .
# Commit changes with the specified commit message
git commit -m "$COMMIT_MESSAGE"
# Pull from main branch
git pull origin main
# Push changes to the remote repository on the specified branch
git push origin "$BRANCH_NAME"
# Output a success message
echo "Changes committed and pushed to Git repository on branch $BRANCH_NAME with message: $COMMIT_MESSAGE"
#!/bin/bash
# Get branch name and commit message from command-line arguments
BRANCH_NAME="$1"
COMMIT_MESSAGE="$2"
# Check if both branch name and commit message are provided
if [ -z "$BRANCH_NAME" ] || [ -z "$COMMIT_MESSAGE" ]; then
echo "Error: Branch name and commit message are required."
exit 1
fi
🔧 **How to Use:**
1. create a file ~/git_commit_push.sh
2. example below. copy pate.
🚀 Exciting News for Developers! 🚀
I have just share Git workflow a whole lot easier! Introducing our new Git automation script 🤖. Now you can commit, push, and deploy with just a few keystrokes!
✨ **Features:**
- **Simplicity:** No more repetitive Git commands!
- **Efficiency:** Commit, push, and deploy instantly.
- **Customization:** Specify branch and commit message effortlessly.
- **Time-Saver:** Spend less time on Git, more time on coding.
"Embrace the challenge, savor the solution. Problem-solving is not just a skill; it's an adventure waiting to be explored.
#ProblemSolver #InnovationMatters 💡🌟"
console.log("Hello, Good Morning today")