thadmiller
thadmiller

Reputation: 559

How to determine a git branch source or find a merge commit

I have 3 main branches: PROD, TEST, and DEVELOP and developers work in feature branches that are created from the PROD branch. And then the feature branch is merged into the environment branches at the respective point in its lifecycle.

I am now seeing commits in PROD and FEATURE branch that should only exist in the TEST branch. I don't know if the FEATURE branch was incorrectly created from the TEST branch (and then merged into PROD), or if the TEST branch was merged into the FEATURE branch before the FEATURE branch was merged back into the PROD branch. Or possibly the TEST branch was incorrectly merged into the PROD branch before the FEATURE branch was created.

I've tried using gitk on both the PROD and FEATURE branches, which is how I'm seeing the TEST branch commits in those branches, but how can I determine when, who, and how this was messed up?

Upvotes: 0

Views: 206

Answers (3)

Jeff Puckett
Jeff Puckett

Reputation: 40841

To see a nice pretty line graph between all your branches that you can scroll back in time to see what got merged where, use:

git log --graph --oneline --decorate --all

If you want to investigate those fishy commits on the PROD branch, then you can just look at it's graph history which will include branch paths that were merged into it with:

git log PROD --graph --oneline --decorate

Upvotes: 2

chandler
chandler

Reputation: 1150

git log --graph

will show the author and date of the commits/merges

Upvotes: 0

otgw
otgw

Reputation: 390

git log will show author, date, time, and commit message, if any

Upvotes: 0

Related Questions