Skip to content

Commit 197d23a

Browse files
author
Eric James Michael Ritz
committed
Describe how to see commits since forking from master
The command in this tip avoids showing merge commits because sometimes developers will merge `master` into their feature branch in the course of development, especially when that feature is in development for a long time. This tip focuses on showing only those commits which introduce new changes and ignores those merge commits for this reason. It also displays the commits in reverse chronological order, oldest to newest, so that the output shows the development of a feature branch in "historical" order. Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
1 parent 3e926cd commit 197d23a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* [Stage parts of a changed file, instead of the entire file](https://github.com/git-tips/tips#stage-parts-of-a-changed-file-instead-of-the-entire-file)
2828
* [Get git bash completion](https://github.com/git-tips/tips#get-git-bash-completion)
2929
* [What changed since two weeks?](https://github.com/git-tips/tips#what-changed-since-two-weeks)
30+
* [See all commits made since forking from master](https://github.com/git-tips/tips#see-all-commits-made-since-forking-from-master)
3031
* [Pick commits across branches using cherry-pick](https://github.com/git-tips/tips#pick-commits-across-branches-using-cherry-pick)
3132
* [Find out branches containing commit-hash](https://github.com/git-tips/tips#find-out-branches-containing-commit-hash)
3233
* [Git Aliases](https://github.com/git-tips/tips#git-aliases)
@@ -177,6 +178,11 @@ curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completio
177178
git whatchanged --since='2 weeks ago'
178179
```
179180

181+
## See all commits made since forking from master
182+
```sh
183+
git log --no-merges --stat --reverse master..
184+
```
185+
180186
## Pick commits across branches using cherry-pick
181187
```sh
182188
git checkout <branch-name> && cherry-pick <commit-ish>

tips.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@
9797
"title": "What changed since two weeks?",
9898
"tip": "git whatchanged --since='2 weeks ago'"
9999
},
100+
{
101+
"title": "See all commits made since forking from master",
102+
"tip": "git log --no-merges --stat --reverse master.."
103+
},
100104
{
101105
"title": "Pick commits across branches using cherry-pick",
102106
"tip": "git checkout <branch-name> && cherry-pick <commit-ish>"

0 commit comments

Comments
 (0)