Git Check which branch contain specific commit

今日公司個 Production project 有一個 Bug 但係在 Staging 和 UAT environment 都 replicate 唔到呢個問題..
之後便用Git Blame 去檢查一下有什麼 code change
再看看是那一個 commit 做了 code change
找到 commit 之後
便要嘗試去看看這個commit merge 了去那些 branch
解決方法

我們可以使用以下 git command

git branch --contains $COMMIT_ID

e.g.
git branch --contains 7df12c5

Hope you find it useful

Chi Yau
Chi Yau
Software Engineer

Interested on Learning new stuff and experience sharing