0

We are using git for a project, making use of git flow (http://nvie.com/posts/a-successful-git-branching-model/) to manage hotfixes, features, etc.

However, somehow the changes in develop (which is weeks ahead of master) have been merged into master, and a recent git push has published the unstable develop branch!

  1. How can I find out who merged develop into master and when this was done?
  2. How can I undo this, given that there will likely have been commits made after this merge, and also given that the new master has been pushed into production?

Thank you, gurus.

EDIT: It turns out that a git flow feature which should have been branched off of develop and merged back into develop was incorrectly merged into master as well (not by git flow, but manually done). I couldn't track it down because the git log --oneline master looked like this:

abcdef Merged branch 'feature/1234' into branch 'master'

EDIT: I've posted a follow up question. Thank you for the feedback thus far.

How can you tell who merged which branch into git?

Community
  • 1
  • 1
magnus
  • 4,031
  • 7
  • 26
  • 48
  • 2
    The merge should appears as a commit in the branch master commit history. You can use git reset to the previous commit id of the merge one. – accurate respondetur Aug 10 '15 at 00:50
  • What happens if you do `git log --graph --oneline origin/master` (assuming a `git fetch` has taken place)? What do you see? Chances are you won't see who specifically merged the branch unless you have a merge commit in the history, but at least this gives you an idea of where to start. – Makoto Aug 10 '15 at 01:17

1 Answers1

0

Well i normally simply do a git log and find out who did what. Just stay on the branch (in your case master) and issue the "git log" command. You should get to see who did what pretty simply.

Som Bhattacharyya
  • 3,972
  • 35
  • 54