1
0
mirror of https://github.com/namibia/tips.git synced 2024-05-30 17:01:11 +00:00

Merge pull request #16 from samarpanda/info_from_commit

Find branches containing commit
This commit is contained in:
hemanth.hm 2015-07-26 09:23:17 +05:30
commit b0562c1366
2 changed files with 17 additions and 0 deletions

View File

@ -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)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -142,5 +143,16 @@ git whatchanged --since='2 weeks ago'
git checkout <branch-name> && cherry-pick <commit-ish>
```
## Find out branches containing commit-hash
```sh
git branch -a --contains <commit-ish>
```
__Alternatives:__
```sh
git branch --contains <commit-ish>
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -83,5 +83,10 @@
{
"title": "Pick commits across branches using cherry-pick",
"tip": "git checkout <branch-name> && cherry-pick <commit-ish>"
},
{
"title": "Find out branches containing commit-hash",
"tip": "git branch -a --contains <commit-ish>",
"alternatives": ["git branch --contains <commit-ish>"]
}
]