1
0
mirror of https://github.com/namibia/tips.git synced 2025-01-03 14:17:28 +00:00

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>
This commit is contained in:
Eric James Michael Ritz 2015-07-29 19:00:56 -04:00
parent 3e926cdc9e
commit 197d23a9b3
2 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,7 @@
* [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) * [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)
* [Get git bash completion](https://github.com/git-tips/tips#get-git-bash-completion) * [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) * [What changed since two weeks?](https://github.com/git-tips/tips#what-changed-since-two-weeks)
* [See all commits made since forking from master](https://github.com/git-tips/tips#see-all-commits-made-since-forking-from-master)
* [Pick commits across branches using cherry-pick](https://github.com/git-tips/tips#pick-commits-across-branches-using-cherry-pick) * [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) * [Find out branches containing commit-hash](https://github.com/git-tips/tips#find-out-branches-containing-commit-hash)
* [Git Aliases](https://github.com/git-tips/tips#git-aliases) * [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
git whatchanged --since='2 weeks ago' git whatchanged --since='2 weeks ago'
``` ```
## See all commits made since forking from master
```sh
git log --no-merges --stat --reverse master..
```
## Pick commits across branches using cherry-pick ## Pick commits across branches using cherry-pick
```sh ```sh
git checkout <branch-name> && cherry-pick <commit-ish> git checkout <branch-name> && cherry-pick <commit-ish>

View File

@ -97,6 +97,10 @@
"title": "What changed since two weeks?", "title": "What changed since two weeks?",
"tip": "git whatchanged --since='2 weeks ago'" "tip": "git whatchanged --since='2 weeks ago'"
}, },
{
"title": "See all commits made since forking from master",
"tip": "git log --no-merges --stat --reverse master.."
},
{ {
"title": "Pick commits across branches using cherry-pick", "title": "Pick commits across branches using cherry-pick",
"tip": "git checkout <branch-name> && cherry-pick <commit-ish>" "tip": "git checkout <branch-name> && cherry-pick <commit-ish>"