Skip to content

Commit b0562c1

Browse files
committed
Merge pull request #16 from samarpanda/info_from_commit
Find branches containing commit
2 parents 9e615c7 + 8dda8b5 commit b0562c1

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* [Get git bash completion](https://github.com/git-tips/tips#get-git-bash-completion)
2525
* [What changed since two weeks?](https://github.com/git-tips/tips#what-changed-since-two-weeks)
2626
* [Pick commits across branches using cherry-pick](https://github.com/git-tips/tips#pick-commits-across-branches-using-cherry-pick)
27+
* [Find out branches containing commit-hash](https://github.com/git-tips/tips#find-out-branches-containing-commit-hash)
2728

2829
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
2930
<!-- @doxie.inject end toc -->
@@ -142,5 +143,16 @@ git whatchanged --since='2 weeks ago'
142143
git checkout <branch-name> && cherry-pick <commit-ish>
143144
```
144145

146+
## Find out branches containing commit-hash
147+
```sh
148+
git branch -a --contains <commit-ish>
149+
```
150+
151+
152+
__Alternatives:__
153+
```sh
154+
git branch --contains <commit-ish>
155+
```
156+
145157
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
146158
<!-- @doxie.inject end -->

tips.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,10 @@
8383
{
8484
"title": "Pick commits across branches using cherry-pick",
8585
"tip": "git checkout <branch-name> && cherry-pick <commit-ish>"
86+
},
87+
{
88+
"title": "Find out branches containing commit-hash",
89+
"tip": "git branch -a --contains <commit-ish>",
90+
"alternatives": ["git branch --contains <commit-ish>"]
8691
}
8792
]

0 commit comments

Comments
 (0)