0

How can you tell based on git history what work is been done by me and what work is been done by some one else?

There are two people working on a project, me(Person A) and my team mate(Person B).

Person A works on 10 files and person B works on another 10 files with one file in common with person A.

  • Person B makes a commit and Push
  • Person A makes a commit
  • Person A makes a pull
  • Person A solve a conflict
  • Person A commit and Push

Now a year latter, I don't remember what files person A and what files person B been working at, how can I check it based on the git history?

Clarification
The problem is that when you commit after merging a conflict, it shows you that you been working on all of the files that are part of that conflict-commits and not only yours.

Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
  • Just check the history using `git log`? – poke May 29 '15 at 14:49
  • Your clarification doesn't really clarify. If B worked on the same file then there will be one commit by B, and another by A, which includes original work by A as well as the work to resolve the conflict (possibly as a separate commit). – tripleee May 29 '15 at 14:55
  • @tripleee how one can tell, if the work to resolve conflict been just that - conflict resolution or that was an actual work on other files? – Ilya Gazman May 29 '15 at 15:01
  • The commit only touches the files which were modified. Usually you would also expect merge resolution commit messages to mention the nature of the commit, but that's obviously just human convention. – tripleee May 29 '15 at 15:04
  • http://stackoverflow.com/questions/424071/list-all-the-files-for-a-commit-in-git – tripleee May 29 '15 at 15:06
  • For me questions is not so clear, but if you want to exlude merges try to use --no-merges option for the `git log`. – manzur May 30 '15 at 13:33

2 Answers2

0

git blame will list which person last modified each line.

user12341234
  • 6,573
  • 6
  • 23
  • 48
0

You can add the --author flag to git-log, which will only show commits for that person. It matches based on name or email address.

Combine it with a few other options and you can get a bit more detailed history:

 git log --graph --oneline --decorate --author="<their-email>@<their-provider>"
Makoto
  • 104,088
  • 27
  • 192
  • 230