We use Git and Github. We have two main branches, staging
and production
. When a new project/feature is assigned to a developer they create a new branch, call it feature-branch
from production
, make their changes, commit, push to GitHub, and merge feature-branch
with staging
using GitHub. When the feature is ready to go live, the developer then merges feature-branch
with production
using GitHub. All merges add a merge
commit.
What happened was that a developer said their feature-branch
contents were on production
and they never performed a merge from feature-branch
to production
. It is possible that someone may have merged staging
with production
accidentally.
Some developers make mistakes and I'm trying to figure out the root at where it happened and possibly reverse it properly. I was hoping someone could help me out.
What I'm trying to do using a combination of GitHub, Git Bash and Git Extensions is find out at what point did a particular file enter a branch. Using Git Extensions file history
feature it only shows when it's changes were committed, not necessarily when it was merged into a branch.
How can I accomplish this? I've searched and used many tactics to find file logs, like git log --pretty=online <branch> -- <file>
found at When was a file added to a branch in Git?.
Any extra help would be appreciated. Please let me know if you need more information and I'll be happy to provide.
Update #1
I forgot to mention this, which is probably important in this scenario. On feature-branch
some changes (change-1
and change-2
) were committed and merged to both staging
and production
. The developer then made further changes (changes-3
) to his feature-branch
and only merged to staging
. While production
should have change-1
and change-2
and not change-3
, how can I find out at what point changes-3
made it's way into production
?