diff --git a/sthope/git_commit b/sthope/git_commit new file mode 100644 index 0000000..cae5185 --- /dev/null +++ b/sthope/git_commit @@ -0,0 +1,17 @@ +#!/bin/bash + +commit_message="Initial commit" + +# Iterate through the arguments to find the --b flag and a branch name +for ((i=1; i<=$#; i++)); do + if [[ "${!i}" == "--commit_msg" && ! -z "${!((i+1))}" ]]; then + commit_message=="${!((i+1))}" + break + fi +done + +git add . + +git commit -m "$commit_message" + +git push --set-upstream origin main