Git change author name / email in longtime commit in command repo

Before creating this question, I already read the answer using git filter-branch exportand git rebase, but none of them apply to my situation here.

So, I joined the company for 3 months, the first commit I made on the repo was under the computer name and email (Unknown / something @something), and that the only commit with this name and email. Now that the email starts to bother us, when we set up a new job at Jenkin, it starts sending email to this address, which leads to the return of email for everyone.

I would like to change the name and email address on this particular commit for myself so that I can fix the problem. However, the problem is this:

  • This is a repo command, I cannot use the filter branch to reset all letters and names.
  • This commit is now thousands per HEAD, I cannot manually reload.
  • After this commit, there are several active branches immediately after the wizard, and they are not yet merged.

I am really looking for a solution to change the author’s name and email address only for this particular commit, and also will not affect anyone else. Please help. Thanks and really appreciate it!

+4
source share
4 answers

So, here is my final decision I just made:

  • , , .
  • .
  • , .
  • , .
  • .
0

.

- , , , . "" -, "" , , .., - , , , , , .

, git " " : , SHA-1 , .. . , , , (, ) .: -)

, , - - git "notes" . - , , git log, - , SHA-1, () , , - - . "- " , SHA-1 .

, . git log, , core.notesRef, refs/notes/commits. - , ?

+3

, git export-branch export git rebase, .

, , - git rebase . , , 1000 HEAD , :

git rebase -i HEAD~1000

, rebase. , , , , . , 999 .

, , .

, , . , . , . , .

, :

  • , ( ).
  • ,
  • (, )
  • ,

, , .

+2

, git replace .

  • ( , . , , GIT_COMMITTER_DATE="2000-01-01T12:00:00" git commit --date==2000-01-01T12:00:00)

  • git replace, commit

  • Hope jenkins understand git replace. If so, he finished (very easy). The added value of this solution is valid here.

  • If not, use the git filter-branch, but that will affect every story (like the other solutions offered), and other developers will hate you (but this solution is much safer than a clean rebase!)

0
source

Source: https://habr.com/ru/post/1607577/


All Articles