fixed typo in gp:bin

This commit is contained in:
Joel Mathew Thomas
2024-06-13 16:02:57 +05:30
parent e93bc632a0
commit 41576f2880
+15 -4
View File
@@ -1,17 +1,28 @@
#!/bin/bash #!/bin/bash
# Check if argument is provided # Check if at least one argument is provided
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
echo "Usage: $0 <commit_message>" echo "Usage: $0 <commit_message> [branch]"
exit 1 exit 1
fi fi
# Add all changes # Add all changes
echo "Staging all changes"
git add . git add .
# Commit with the provided argument # Commit with the provided argument
echo "Commiting all changes"
commit_message="$1" commit_message="$1"
git commit -m "$commit_message" git commit -m "$commit_message"
# Push changes to the master branch of the origin remote # Check if a branch name is provided, otherwise use 'master'
git push -u origin master if [ -z "$2" ]; then
echo "No branch was specified, using default master"
branch="master"
else
branch="$2"
fi
# Push changes to the specified branch of the origin remote
echo "Pushing to $branch"
git push -u origin "$branch"