Git Product home page Git Product logo

rewrite-git-author's Introduction

Rewrite Git Author

The easy way to replace an email address across all commits in a repo

GitHub tag License

Made with Bash

A simple tool to replace the email address for all commits in a repo by a user - using a single command. The timestamps and patches of the commits are left as is.

⚠️ Warning

Since a rebase is done here, this tool rewrites your Git history of commits. So you'll have to force-push your changes and get everyone to pull in the changes.

Further, every commit in the history back to the first commit will get rewritten, even if nothing changed in the commits. So don't use this to just fix a few recent commits - rather fix those by hand, or submit an issue or PR improve this tool to only go back to a certain commit!

See further warnings in the git filter-branch docs.

Sample usage

Run the shell script:

$ rewrite_author.sh OLD_EMAIL NEW_MAIL

Then check your Git log and force push if you're satisfied.

e.g. If your ran this:

Then your commits will be changed from the old email like:

Author: Foo Bar [email protected]
Date:   Thu Jun 24 20:08:18 2021 +0200

To the new email:

Author: Foo Bar [email protected]
Date:   Thu Jun 24 20:08:18 2021 +0200

Alternative

Instead of using this tool, see git filter-name.

Documentation

view - Documentation

See that for how to set up and run this tool and for more info on how this works.

It also has instructions for how to update an email address for a single commit with plain Git.

License

Released under MIT by @MichaelCurrin.

rewrite-git-author's People

Contributors

michaelcurrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

disouzam

rewrite-git-author's Issues

Include the Author name as well

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.