Skip to content

Instantly share code, notes, and snippets.

@caugner
Created February 9, 2017 11:22
Show Gist options
  • Save caugner/5b7920a5a2fa25cda2a0d1bf353e2058 to your computer and use it in GitHub Desktop.
Save caugner/5b7920a5a2fa25cda2a0d1bf353e2058 to your computer and use it in GitHub Desktop.
A git commit alias to commit at time of last change.
#!/bin/bash
# cac = commit-at-changetime
alias git-cac=git commit --date="$(git ls-files --modified | xargs stat | grep "Modify: " | sort | tail -1 | awk '{gsub("Modify: ", "", $0); print $0}')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment