Skip to content

Instantly share code, notes, and snippets.

@vbrozik
Last active June 30, 2023 18:04
Show Gist options
  • Save vbrozik/c493ca1f8e7dad05dacc726e56ff853c to your computer and use it in GitHub Desktop.
Save vbrozik/c493ca1f8e7dad05dacc726e56ff853c to your computer and use it in GitHub Desktop.
Git - useful commands

Git - useful commands

git diff

# Check staged changes in minimal diff (just file names and changed lines)
# keeping coloring, less needs -R to pass colors
git diff --staged -U0 --color | grep -Pv '^(\e\[.{1,2}m)?(---|\+\+\+|index)' | less

# Note: None of these codes for ASCII ESC worked in GNU grep -E \e \x1b \033

GitHub

  • Scripts in the repository vbrozik/vb-shell-tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment