See git a list of all commits that went between two commits (across branches)

JaSn

I have two branches where commits are made independently and I would like to run a Git command that will show me all commits that went in between a certain timeframe (expressed as commit hashes) regardless of branch.

This is my test repo for the purpose of demonstration: https://github.com/jsniecikowski/testApp

If we were to imagine Git's history as a list (latest on top):

  • 4332e0e on release branch
  • 18bc14a on release branch
  • 90f9149 on master branch
  • 4f6e07f on release branch
  • ca404cf on release branch
  • 6cf47b3 on release branch

then I would like to say: 'give me all changes that happened between '90f9149' and '4332e0e'. Ideally I would get one commit: 18bc14a

My understanding is that this command would work:

git log --full-index --no-abbrev --format=raw -M -m --raw 90f9149d2f7367738e9d6f4a53c2c325f96a9b5f..4332e0eb24e18119b10835e361915f1f5eff16bc

However, this command is returning more results than expected.

Is this a bug with git, or am I missing something in my command?

JaSn

Gauthier's excellent answer was very close but it didn't say how to use hashes for specifying the region we want to check.

Building on top of that I did:

git log Build-Release-Testing --since="$(git log -1 90f9149d2f7367738e9d6f4a53c2c325f96a9b5f --pretty=%ad)" --until="$(git log -1 4332e0eb24e18119b10835e361915f1f5eff16bc --pretty=%ad)"

The remaining part is to eliminate the specified hashes from the return.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

git reset all commits in diff of two branches

From Dev

Count number of commits between tag creation and current HEAD commit across all branches in git

From Dev

Searching for a string in a git repository, across all branches/commits/stashes/etc

From Dev

Git divide commits between branches

From Dev

git workflow for frequently exchanging commits between two branches

From Dev

Get a list of all tags between two commits

From Dev

Get a list of changed files between two commits or branches

From Dev

In Git, list names of branches with unpushed commits

From Dev

git list remote branches, order by number of commits

From Dev

How to list all commits and related changes between two different versions using git

From Dev

How to see commits applied to a submodule between two commits of parent repository?

From Dev

git - How to checkout all changed files between two commits

From Java

In GitHub, is there a way to see all (recent) commits on all branches?

From Dev

List git commits to master branch between two dates

From Dev

Git diff between two commits without some commits in the middle

From Dev

Git: get commits between two commits on a specific branch

From Dev

Difference between git merge with commits in common and git merge with unrelated branches

From Dev

How to drop all commits between two commits without interactive rebase

From Dev

How many lines of code differs between two commits or two branches?

From Dev

how can i see the changes(git commits) between two TeamCity builds of my choice

From Dev

Does "git push" push all commits from other branches?

From Dev

How can I count number of commits between two branches?

From Java

getting difference of commits between two branches using gitpython

From Dev

Git log: list all parents commits

From Dev

How to list branches in git with the number of commits ahead or behind master?

From Dev

How to list commits directly between two tags

From Dev

List commits from all remote branches except one

From Dev

git view/copy files from all commits across the history

From Dev

Git: Two initial commits

Related Related

  1. 1

    git reset all commits in diff of two branches

  2. 2

    Count number of commits between tag creation and current HEAD commit across all branches in git

  3. 3

    Searching for a string in a git repository, across all branches/commits/stashes/etc

  4. 4

    Git divide commits between branches

  5. 5

    git workflow for frequently exchanging commits between two branches

  6. 6

    Get a list of all tags between two commits

  7. 7

    Get a list of changed files between two commits or branches

  8. 8

    In Git, list names of branches with unpushed commits

  9. 9

    git list remote branches, order by number of commits

  10. 10

    How to list all commits and related changes between two different versions using git

  11. 11

    How to see commits applied to a submodule between two commits of parent repository?

  12. 12

    git - How to checkout all changed files between two commits

  13. 13

    In GitHub, is there a way to see all (recent) commits on all branches?

  14. 14

    List git commits to master branch between two dates

  15. 15

    Git diff between two commits without some commits in the middle

  16. 16

    Git: get commits between two commits on a specific branch

  17. 17

    Difference between git merge with commits in common and git merge with unrelated branches

  18. 18

    How to drop all commits between two commits without interactive rebase

  19. 19

    How many lines of code differs between two commits or two branches?

  20. 20

    how can i see the changes(git commits) between two TeamCity builds of my choice

  21. 21

    Does "git push" push all commits from other branches?

  22. 22

    How can I count number of commits between two branches?

  23. 23

    getting difference of commits between two branches using gitpython

  24. 24

    Git log: list all parents commits

  25. 25

    How to list branches in git with the number of commits ahead or behind master?

  26. 26

    How to list commits directly between two tags

  27. 27

    List commits from all remote branches except one

  28. 28

    git view/copy files from all commits across the history

  29. 29

    Git: Two initial commits

HotTag

Archive