Created
August 25, 2025 17:55
-
-
Save clifferson/9f40117f1b440562fb120268558b0c87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A simple script to add all changes, commit with a custom message, and push to the remote repository. | |
# Check if a commit message was provided as a command-line argument. | |
if [ -z "$1" ]; then | |
echo "Error: Please provide a commit message." | |
echo "Usage: ./git-commit-all.sh \"Your commit message here\"" | |
exit 1 | |
fi | |
# Add all files to the staging area. | |
echo "Staging all changes..." | |
git add . | |
# Commit the changes with the provided message. | |
echo "Committing with message: '$1'..." | |
git commit -m "$1" | |
# Push the changes to the remote repository. | |
echo "Pushing changes to remote repository..." | |
git push | |
echo "Operation complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment