Skip to content

Instantly share code, notes, and snippets.

@louisswarren
Last active July 9, 2020 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save louisswarren/c1c9021ac08f317ad13cf203995cc9a0 to your computer and use it in GitHub Desktop.
Save louisswarren/c1c9021ac08f317ad13cf203995cc9a0 to your computer and use it in GitHub Desktop.
Scripts for a git demo
#!/bin/sh
git ls-tree -r --name-only ${1:-master}
#!/bin/sh
mkdir -p .git/head
git config color.ui always
#!/bin/sh
watch -n 0.5 -t 'find -type f -not -path "./.git/*" | xargs tail -n +1'
#!/bin/sh
watch -n 0.5 -ct git diff
#!/bin/sh
watch -n 0.5 -ct git diff --cached
#!/bin/sh
watch -n 0.5 -t 'rm -rf .git/head/*; git ls-tree --full-tree HEAD --name-only | while read x; do git show "HEAD:$x" > ".git/head/$x"; done; cd .git/head; find -type f | xargs tail -n +1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment