tbeseda

=> Home | All Posts

gitclean zsh command

gitclean() {
  git clean -Xdn
  if read -q REPLY\?"Clean these? (Y/y)"; then
    git clean -Xdf
  else
    echo "Still dirty."
  fi
}

For more fancy, use "gum":

gitclean() {
  DIRTY=$(git clean -Xdn | sed 's/Would remove //g')

  gum style \
    --foreground 196 --border thick --border-foreground 88 \
    --margin "1 2" --padding "1 3" "$DIRTY"

  gum confirm "🧹 Delete these?" \
    && git clean -Xdf \
    || echo "Still dirty."
}

=> gum docs | gist version with preview image


=> All Posts

Proxy Information
Original URL
gemini://tbeseda.smol.pub/gitclean-zsh
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
239.341536 milliseconds
Gemini-to-HTML Time
0.326664 milliseconds

This content has been proxied by September (ba2dc).