Change author name for previous commits: expedited forwarding rejected

I recently opened a repo on GitHub. I am new to Git. As usual with newcomers, I used the default name and email, which I, according to the best tradition of the noob, discovered the five commandments too late. Now the fun begins because I started looking for information on how to change the name of the author and committer of these commits. Good. I basically found the following information and lots of copies:

The problem does not seem unusual. I can only say that none of the solutions worked. Half of them are variants of the same git filter-branch -f --env-filter script. I tried several times to work on this script. The problem is that after applying the script I cannot click. Fast Forward Rejects or something like that. Great, the only way to continue is to pull. After pulling out all the old data again appears + a new branch with new information. I am already sitting here with four branches merged into the most egregious ways, all containing the same information with different names of authors, including the one I wanted to delete.

OK, in order to shorten it, I also tried to delete the selected commits that generate conflicts related to hair that I cannot solve (like ???), and deflate some of the commits to new ones with the correct author of information, which leads to the destruction of the current project status. Even better, I get a segmentation error sometimes after running git rebase -i , which I am informed about here: http://lists-archives.org/git/729800-rebase-i-segmentation-fault-and-another-problem.html completely logical. The only thing (fortunately) that works is git rebase --abort , which saved my ass several times.

I hope that my disappointment will not be reflected, but instead entertain you and encourage you to help me. I would like to:

  • To delete the specified author information, finally

  • Bonus: get rid of all branches containing the same information.

But I would be pleased with the first, if the obstacle to removing past branches without destroying the current state is too much for Git newbies. Thanks in advance.

+7
source share
2 answers

The problem is that after applying the script I cannot click. Fast Forward Rejects or something like that.

This issue cannot be fixed if you are trying to change the story. Git push rejection as it results in data loss; in this case, the data are old authors. You just need to git push with the --force flag --force tell you that you are sure of what you are doing.

Masses in Git can be a pain to solve. If master is a mess, I usually just go back in history with git checkout HEAD~ until I get back to the time when everything was okay. I then git branch --force master to reset master to this point. Finally, I delete all messy branches with git branch -D badBranch .

Be careful.

+5
source

If no one has executed your repo yet, just change the local repo and force click on GitHub. Accept any embarrassment. I (re) created a repo for several weeks in a similar vein.

This is more difficult if it is a student project and the lecturer has already pulled it - just so that you appreciate the value of a good administrator, -)

+1
source

All Articles