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

Avatar
Chi Yau
Software Developer

Intererest to share knowledge / experience

Related

comments powered by Disqus