Skip to content

Commit 3048cfb

Browse files
committed
add git cherry tip
1 parent 214d46d commit 3048cfb

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
* [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files)
4949
* [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory)
5050
* [Update all the submodules](https://github.com/git-tips/tips#update-all-the-submodules)
51+
* [Show all commits in the current branch yet to be merged to master](https://github.com/git-tips/tips#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master)
5152

5253
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
5354
<!-- @doxie.inject end toc -->
@@ -204,7 +205,7 @@ git log --no-merges --stat --reverse master..
204205

205206
## Pick commits across branches using cherry-pick
206207
```sh
207-
git checkout <branch-name> && git cherry-pick <commit-ish>
208+
git checkout <branch-name> && cherry-pick <commit-ish>
208209
```
209210

210211
## Find out branches containing commit-hash
@@ -329,5 +330,16 @@ git clean -df
329330
git submodule foreach git pull
330331
```
331332

333+
## Show all commits in the current branch yet to be merged to master
334+
```sh
335+
git cherry -v master
336+
```
337+
338+
339+
__Alternatives:__
340+
```sh
341+
git cherry -v master <branch-to-be-merged>
342+
```
343+
332344
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
333345
<!-- @doxie.inject end -->

tips.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,10 @@
186186
{
187187
"title": "Update all the submodules",
188188
"tip": "git submodule foreach git pull"
189+
},
190+
{
191+
"title": "Show all commits in the current branch yet to be merged to master",
192+
"tip": "git cherry -v master",
193+
"alternatives": ["git cherry -v master <branch-to-be-merged>"]
189194
}
190195
]

0 commit comments

Comments
 (0)