Skip to content

Instantly share code, notes, and snippets.

@jirikuncar
Last active August 29, 2015 14:17
Show Gist options
  • Save jirikuncar/71c187adaa125148039d to your computer and use it in GitHub Desktop.
Save jirikuncar/71c187adaa125148039d to your computer and use it in GitHub Desktop.
git: update year
COMMIT=$1
YEAR=`date +"%Y"`
START=${YEAR:0:3}
END=${YEAR:3:4}
CMD="sed -i '' 's/\($START[^$END]\) CERN\.$/\1, $YEAR CERN./'"
echo $CMD `git diff-tree --no-commit-id --name-only -r $COMMIT` | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment