This commit is contained in:
pika 2025-03-24 13:58:25 +01:00
parent 89aab779e8
commit 4961cf01b0

41
.zshrc
View file

@ -354,17 +354,42 @@ __alias__() {
alias gcm="git commit -m" alias gcm="git commit -m"
alias gpu="git push --recurse-submodule=on-demand" alias gpu="git push --recurse-submodule=on-demand"
gsu() { gsu() {
echo "-- pulling submodules --" echo_info "Pulling submodules..."
git submodule foreach git pull --recurse-submodule if git submodule foreach git pull --recurse-submodule; then
echo "-- updating submodules --" echo_info "Submodules pulled successfully."
git submodule update --init --recursive else
git diff . && echo_error "Failed to pull submodules."
return 1
fi
echo_info "Updating submodules..."
if git submodule update --init --recursive; then
echo_info "Submodules updated successfully."
else
echo_error "Failed to update submodules."
return 1
fi
if git diff .; then
echo_info "Staging changes..."
git add . git add .
sleep 0.3 sleep 0.3
git commit -m " update: submodules" if git commit -m " update: submodules"; then
git push && echo_info "Changes committed successfully."
echo "push successfull" else
echo_error "Failed to commit changes."
return 1
fi
else
echo_info "No changes to commit."
fi
if git push; then
echo_info "Push successful."
else
echo_error "Failed to push changes."
return 1
fi
} }
gwip() { gwip() {
# Fetch the latest changes from the remote # Fetch the latest changes from the remote