millisami
millisami

Reputation: 10151

How to search/know the commiter of source code changed in Git?

I have always wondered to know the commiter/author of a particular piece of code by looking up the git history.

Using git, can I know the author who commited this piece of code by looking in the git history?

Upvotes: 0

Views: 440

Answers (2)

odez213
odez213

Reputation: 723

Yes, you can use git blame to see line by line change.

Upvotes: 3

Abizern
Abizern

Reputation: 150565

Git has multiple ways of showing who changed what.

  1. git blame shows the changes by author and commit per line as odez909 has answered.
  2. Looking at the output of git log will also show you who created the change in the author field.
  3. git log will also show a 'committer' field. This is useful in a distributed version control system like git and it shows the person who added the commit to the repository, and it may not be the author.

Upvotes: 0

Related Questions