From 89aab779e8d40a519075e4546d8abf7a2101b762 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 24 Mar 2025 13:57:25 +0100 Subject: [PATCH] . --- .zshrc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index f8510f0..60f179e 100644 --- a/.zshrc +++ b/.zshrc @@ -363,10 +363,28 @@ __alias__() { sleep 0.3 git commit -m " update: submodules" git push && - echo_info "push successfull" + echo "push successfull" - error_log } + gwip() { + # Fetch the latest changes from the remote + git fetch + + # Get the current branch name + local branch + branch=$(git rev-parse --abbrev-ref HEAD) + + # Check if there are any changes on the remote branch + if git diff --quiet "$branch" "origin/$branch"; then + echo "No changes on the remote branch. Adding changes and pushing with 'wip' commit." + git add . + git commit -m "wip" + git push + else + echo "There are changes on the remote branch. Please pull the latest changes first." + fi + } + if command_exists lazygit; then alias lg="lazygit" fi