From b9888285ab48e5e06dfbcf770e66f0db7756d4dd Mon Sep 17 00:00:00 2001 From: Phil Date: Fri, 22 Jan 2021 17:07:12 +0000 Subject: [PATCH] Fixed Git Function --- .bash_aliases | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.bash_aliases b/.bash_aliases index 0436b87..285cc2f 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -55,12 +55,32 @@ fi } function gac() { +if [ -d ".git" ]; then echo "Log Message: " read logmessage -git add --all && git commit --allow-empty-message -m "$logmessage" +git add . --all && git commit --allow-empty-message -m "$logmessage" +else +echo "No .git Folder found in Directory. Are you in the Correct Folder?" +fi } +# Pull all Git repos in this dir +function pullall() { + for dir in */ ; do + # Execute in subshell + ( + cd "$dir" || exit 1 + # If it's a git directory, then update it + if test -d .git; then + echo "$dir is a Git repo. Pulling master branch..." && git checkout master && git pull && echo "" + else + echo "$dir is not a Git repo." && echo "" + fi + ) + done +} + # Updates packages from all sources function update() { if command -v snap >/dev/null; then