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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.