How do I know when a branch (or a commit) was merged into another branch? For example - given I have branch1 and master and, sometime in the past, branch1 was merged into master, how can I know when a specific commit was introduced into the main branch? As far as Git cares, once the commit is reachable from master, it's there.
See example (windows) script to illustrate the problem:
rd .git /s /q
del data.txt
git init
echo 1 > data.txt
git add data.txt
git commit -m initial_commit_master
git checkout -b branch1
echo 2 > data.txt
git add data.txt
git commit -m commit_in_branch1
git checkout master
git merge branch1
echo 3 > data.txt
git add data.txt
git commit -m 2nd_commit_master
How do I recognize that "2" (in data.txt) came from branch "branch1" and the earliest point it was joined to master?
Edit 1: An example use case - since we deploy from master, I'm interested to know when a specific change was actually introduced to production. I know it's in master now ("2" was in master at some point) - but I don't know when it was put into master because all I see is the image today, not the image that was.