diff --git a/README.md b/README.md index 0ee8d02..a231599 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ * [Get git bash completion](https://github.com/git-tips/tips#get-git-bash-completion) * [What changed since two weeks?](https://github.com/git-tips/tips#what-changed-since-two-weeks) * [Pick commits across branches using cherry-pick](https://github.com/git-tips/tips#pick-commits-across-branches-using-cherry-pick) +* [Find out branches containing commit-hash](https://github.com/git-tips/tips#find-out-branches-containing-commit-hash) @@ -142,5 +143,16 @@ git whatchanged --since='2 weeks ago' git checkout && cherry-pick ``` +## Find out branches containing commit-hash +```sh +git branch -a --contains +``` + + +__Alternatives:__ +```sh +git branch --contains +``` + diff --git a/tips.json b/tips.json index 79cd53c..d6e6904 100644 --- a/tips.json +++ b/tips.json @@ -83,5 +83,10 @@ { "title": "Pick commits across branches using cherry-pick", "tip": "git checkout && cherry-pick " + }, + { + "title": "Find out branches containing commit-hash", + "tip": "git branch -a --contains ", + "alternatives": ["git branch --contains "] } ]