Fixed Git Function

This commit is contained in:
Phil 2021-01-22 17:07:12 +00:00
parent 4f847b0dd1
commit b9888285ab

View File

@ -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