Giter Site home page Giter Site logo

adamdehaven / change-git-author Goto Github PK

View Code? Open in Web Editor NEW
107.0 4.0 18.0 34 KB

Update the commit history of your git repository to resolve incorrect author information.

Home Page: https://www.adamdehaven.com/blog/update-commit-history-author-information-for-git-repository/

License: MIT License

Shell 100.00%
git author commits script

change-git-author's Introduction

change-git-author's People

Contributors

adamdehaven avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

change-git-author's Issues

Unable to run on OSX

This is really nice but it doesn't seem to work for me? I'm on the latest OSX version using bash locally for my shell. Nothing fancy going on.

However when I run the script I see a couple different errors depending on how I choose to run it. I'm not a bash expert so I may be overlooking something here. 😁

I confirmed it's marked as executable

repo on  master [$?] via ⬢ v10.18.1 
❯ ls -l
total 1104
-rw-r--r--     1 cbzehner  staff    2514 Nov 10 21:19 README.md
-rwxr-xr-x     1 cbzehner  staff   17805 Nov 10 22:04 changeauthor.sh

Just trying to run it as expected

repo on  master [$?] via ⬢ v10.18.1 
❯ ./changeauthor.sh -o [email protected] -e [email protected]
: No such file or directory

Calling it with bash directly gives a different error

repo on  master [$?] via ⬢ v10.18.1 took 2s 
❯ bash changeauthor.sh 
: command not foundne 2: 
: command not foundne 9: 
: command not foundne 11: 
: command not foundne 24: 
: command not foundne 31: 
: command not foundne 34: 
: command not foundne 36: 
'hangeauthor.sh: line 43: syntax error near unexpected token `in
'hangeauthor.sh: line 43: `  case "$1" in

Change user name only

I my case I had to change the user name while keeping the same email address.
Thus, I have commented the lines checking [ "$USER_OLD_EMAIL" == "$USER_NEW_EMAIL" ] and everything has been successfully renamed. 👍

I think, in interactive mode, the script should warn and ask the user if the intention is actually to change the user name while keeping the same email address.

A command line argument may also be added for that case where only one email address is requested.

Repository must have a remote setup to run

Just a quick note for your consideration. I ran changeauthor.sh against a local git repository without any remotes set up and it exited early at the VALID_REMOTES check.

I just commented out that section and proceeded as planned, but I want to bring this up in case you haven't encountered this case before.

change author with space in e-mail

Hello,

first thank you for your script, it fixed some e-mail problemes in my git repo.

But i have one commiter e-mail with a space in it.
e.g. Name @example.com.
If i set the old-email to Name @example.com he takes only Name.
If i set Name\ @example.com he takes the space, but i think the check fails.
USER_OLD_EMAIL_EXISTS="$(git ${USER_GIT_DIR} ${USER_WORK_TREE} log --pretty=format:"%ae" | grep -wxi ${USER_OLD_EMAIL})"

integer expression expected

test on 5.1.8 and 3.2.57 of Bash
foo unset
/bin/bash -c '[ "$foo" -eq 0 ]' will cause the error
work if change -eq to =

Showing 2 timelines in GitHub network graph

Hey, Thanks for creating this useful tool.
I recently used it and saw that it creates new network graph and the old one still persists.
Here is a link to my GitHub repo.
Is there any workaround for this?

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.