Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is "author" determined for a git commit when rebasing and squashing?

I rebased a coworkers branch that had 2 commits and squashed the second commit into the first one. It preserved the original author (i.e. not me).

Suppose I want to fix one line of code, so I reverse a hunk and make a new commit.

At this point, I'm back where I started, with two commits that I want to squash together, and want to preserve the original author. However, in the earlier case both commits had the same author. In this latter case, the commits being squashed have different authors. Which author will git assign to the new rebased/squashed commit?

like image 765
Triynko Avatar asked Nov 20 '22 15:11

Triynko


1 Answers

As noted in the comments, when doing a 'squash', the author remains the one whose commit you are squashing into.

like image 159
Sean Houlihane Avatar answered Dec 09 '22 10:12

Sean Houlihane