Skip to content

Instantly share code, notes, and snippets.

@ProExpertProg
Created October 15, 2025 07:07
Show Gist options
  • Save ProExpertProg/01a5e34d45898bb04e451c206c5c4897 to your computer and use it in GitHub Desktop.
Save ProExpertProg/01a5e34d45898bb04e451c206c5c4897 to your computer and use it in GitHub Desktop.
Git TODOs
[alias]
todos = "!sh -c ' \
[ $GIT_PREFIX ] && cd $GIT_PREFIX; \
git status --short --branch $*; \
git --no-pager diff -U0 main | \
grep \"^+.*TODO\" | \
sed \"s/^+//\" | \
git --no-pager grep -nFf - -- $(git --no-pager diff --name-only main) 2> /dev/null' -"
pr = "!f() { repo=\"origin\"; if [ $# -eq 2 ]; then repo=$1; pr=$2; else pr=$1; fi; git fetch $repo pull/$pr/head:pr-$pr && git checkout pr-$pr; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment