Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the Author name as well #1

Closed
lee-40square opened this issue Jul 26, 2022 · 4 comments
Closed

Include the Author name as well #1

lee-40square opened this issue Jul 26, 2022 · 4 comments

Comments

@lee-40square
Copy link

Sorry, I'm not good enough with Git to offer a PR. However, I wonder if the script could be modified so that it can change the Author name as well as the email?

Thank!

@MichaelCurrin
Copy link
Owner

Hi this is possible but not straightforward as I need to do a lot of argument parsing to separate email and name and keep the ability to only set email without name.

@MichaelCurrin
Copy link
Owner

Would you be willing to install and run git filter-repo tool which is similar to git filter-branch which my tool uses?

I worked out some commands for you

@MichaelCurrin
Copy link
Owner

Install and run the git-filter-repo tool, which is linked from the git-filter-branch official docs as a better replacement.

Examples

Example from their docs, modified here for clarity. Note use of Python code for callbacks.

$ git filter-repo --email-callback '
  return b"new@example.com" if email == b"old@localhost" else email
'

Take that further:

$ git filter-repo --name-callback '
  return b"New name" if name == b"Old name" else name
'

@lee-40square
Copy link
Author

lee-40square commented Nov 9, 2022

Thanks for the effort Michael and thanks for pointing me to this. (and sorry for the late reply).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants