简体   繁体   中英

git log does not show all commits

I have been learning a lot about the git log lately and would like to write it to a file so I can process it and write a changelog/release notes from it. However, when I write the git log between two commits or two tags I lose a lot of the commits in between. I'm not sure why this is. I checked the GitHub network graph and checked the commit history on GitHub manually and the commits that I lose are commits belonging to the branch, so I am thinking that my commands are wrong or incomplete.

Here is what I have done and tried

  • in git bash, navigate to the directory where the respective.git folder is
  • check out the respective branch (dev in my case)
  • see the full history, no merge commits (written to file)
    $ git log --pretty=oneline --no-merges --decorate=short > file1.txt
    This gives me what I need in terms of amount of information; the output looks like this (please ignore the commit messages themselves...):

a384d44ff80de33aebd9057f3c99e822440fa545 Adjusted dev version (#13)
6ddf190dd11bcc71552b482b4751acc7c98a74d2 (tag: 0.0.1) 0.0.1
f7fb130f7b3f48d5fc0b2edde2bb888a891c76a6 Back to 0.1.1
881e70c8df9a3df6ec8ee8cba13b39165e9db179 Update DESCRIPTION version
d3dc1169705c5f48748bcd72d07ebd2bf5eff59f Update DESCRIPTION version
b766875b4fcaa978f6ec85129a2542ed5dd44762 Update description file version number to match version tag
ed04156444914785b002b5c94b501ed54b5b99a4 (origin/vd-networkPl) Debugging to fix issue with igraph graph_from_data_frame()
dd96aca4db22d5b9921726795642a2358248526d Write network plot vignettes
64d216700a9df8393eeab0b2c6967554da18a092 Update codex to work with network plot

  • Then I try to narrow it down, so only write the history between two commits or two tags
    git log --pretty=oneline --no-merges --decorate=short commit1..commit2> file2.txt
    or
    git log --pretty=oneline --no-merges --decorate=short 0.0.0..0.0.1> file3.txt
    In both cases, I loose hundreds of commit messages. Instead of having a file with hundreds of lines, I get 24. I know that I don't have hundreds of merge commits, so what am I missing here?

Sorry I didn't add a reproducible example. All my repositories are private (company regulations) so I wasn't sure how to create a reproducible example.

Try --all option

git log --all

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM