Skip to content

Instantly share code, notes, and snippets.

View malkam03's full-sized avatar
🎯

Malcolm Davis malkam03

🎯
View GitHub Profile
@malkam03
malkam03 / git-add-commit.sh
Last active August 9, 2023 10:16
Bash script to do a git add and a git commit with message in one line and with multiple files.
#!/bin/bash
echo "Adding and commiting files"
# loop for all files until reach to a -m
while [ "$1" != "" ] && [ "$1" != "-m" ]; do
#Print the file name that is being added
echo "Adding to staging area $1"
#Adds the file
git add "$1"
#Go to the next parameter