fixed gwip command, to use only one file optionally

This commit is contained in:
pika 2025-05-11 12:46:23 +02:00
parent 7bfea6a9d8
commit ff2b5afb49

3
.zshrc
View file

@ -410,8 +410,9 @@ __git__() {
# Check if there are any changes on the remote branch
if git diff --quiet "$branch" "origin/$branch"; then
local commit_message="${1:-wip}"
local commit_files="${2:-.}"
echo "${CYAN}No changes on the remote branch. Adding changes and pushing with ${RED}${BOLD}'$commit_message'${NC}${CYAN} commit.${NC}"
git add .
git add "$commit_files"
git commit -m "$commit_message"
git push
else