Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Created January 4, 2017 07:06
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save zulhfreelancer/fbc417b67d9fd51354512643d9f335bd to your computer and use it in GitHub Desktop.
Save zulhfreelancer/fbc417b67d9fd51354512643d9f335bd to your computer and use it in GitHub Desktop.
How to see Git logs between 2 commits?
git log --oneline 7de7970..master

OR

git log --oneline 7de7970..4cb34a9

Above command will give all logs between commit A and commit B including commit A and commit B.

@dimovnike
Copy link

is there a way to do this on the github.com site? (without having to clone the repository)

@siepet
Copy link

siepet commented Nov 27, 2018

@nirizr
Copy link

nirizr commented Jul 7, 2020

Is there a way to only get logs between commit A and commit B, including commit A and excluding commit b?

In the git log --oneline abcdefg..master, I only want to see changes added to master, not including the master commit.

@mochadwi
Copy link

@dimovnike
You can compare on github like this:
https://github.com/user/repository/compare/commit1..commit2

thanks!

@dlemfh
Copy link

dlemfh commented Oct 14, 2022

Is there a way to only get logs between commit A and commit B, including commit A and excluding commit b?

In the git log --oneline abcdefg..master, I only want to see changes added to master, not including the master commit.

Try: git log --oneline ^master master... abcdefg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment