Skip to content

Instantly share code, notes, and snippets.

@ErikGranse
Last active March 17, 2023 02:43
Show Gist options
  • Save ErikGranse/30e4500b507d21f341eda2e12ba6d970 to your computer and use it in GitHub Desktop.
Save ErikGranse/30e4500b507d21f341eda2e12ba6d970 to your computer and use it in GitHub Desktop.
[alias]
rekt = reset --hard
tidy = !git remote prune origin && git branch -vv | grep ':gone]' | awk '{print }' | xargs git branch -D
unwatch = update-index --assume-unchanged
watch = update-index --no-assume-unchanged
unwatched = "!git ls-files -v | grep '^[[:lower:]]'"
watchall = "!git unwatched | xargs -L 1 -I % sh -c 'git watch `echo % | cut -c 2-`'"
@ErikGranse
Copy link
Author

ErikGranse commented Dec 1, 2022

  • git rekt is pretty obvious.
  • git tidy removes all local refs to branches that have been removed upstream.
  • unwatch will cause Git ignore changes in tracked files; watch removes that restriction. Note that a reset --hard will cause unwatched files to be reset.
  • unwatched lists all files affected by unwatch. The *watch* aliases weren't written by me, but I forget where I found them. Will add credit if I find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment