Skip to content

Instantly share code, notes, and snippets.

@bignimbus
Last active July 12, 2016 18:19
Show Gist options
  • Save bignimbus/ac2f212b6a674e8940e5f581a5f835ea to your computer and use it in GitHub Desktop.
Save bignimbus/ac2f212b6a674e8940e5f581a5f835ea to your computer and use it in GitHub Desktop.
Execute a global rename only on files that were modified in a particular git branch. Useful for renaming files after a code review and never "missing a spot."
git diff-tree --no-commit-id --name-only -r your-branch-name | xargs sed -ie 's/oldName/newName/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment