mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add List Commits On A Branch as a git til
This commit is contained in:
20
git/list-commits-on-a-branch.md
Normal file
20
git/list-commits-on-a-branch.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# List Commits On A Branch
|
||||
|
||||
You can list all commits that have taken place since a branch split off from
|
||||
another branch using `git log`. You just need to specify a ref range with
|
||||
the originating branch and the branch of interest.
|
||||
|
||||
```bash
|
||||
$ git log master..my-feature-branch
|
||||
```
|
||||
|
||||
That will list all commits on `my-feature-branch` since it branched off from
|
||||
`master`.
|
||||
|
||||
I like to tighten up the output a bit with a flag:
|
||||
|
||||
```bash
|
||||
$ git log master..my-feature-branch --oneline
|
||||
```
|
||||
|
||||
See `man git-log` for more details.
|
||||
Reference in New Issue
Block a user