Git Only Shows Most Recent Commit

I am having an issue where git log only shows me the most recent commit instead of all the commits I ever done (I use bash). Is there another way for me to see all the commits in the terminal?

Hey there,

it is hard to help you because we do not know much about your development environment.

Questions:

  • Are you in the correct folder? pwd
  • Are you in the correct git branch? git branch
  • Are the missing commits in other branches? git log and looking at the line behind the commit number: 2022-02-04_08-18
  • Did you do some actions that can change your git history, e.g. git reset, git rebase?
1 Like

What about the other projects you have with Git. Does this happen in your other projects or just one of them?
Try this enhanced git log line:

git log --graph --abbrev-commit --decorate --all --format=format:'%C(bold blue)%h%C(reset) %C(bold green)%ar%C(reset) %C(white)%s%C(reset) %C(magenta) %an%C(reset)%C(bold yellow)%d%C(reset)'

This also happens in my other django projects. When I used your command it showed me all the commits but it does not give me a commit number for any commit Is there a way to add to this command to get the number?

Are you in the correct folder? Yes
Are you in the correct git branch? Yes
Are the missing commits in other branches? It just gives me my most recent commit.
Did you do some actions that can change your git history? No

So I suggest that you upload the repo to github or gitlab and send us the url, so we can test if this is on your end or on the repo’s end.

Okay here is a github link then https://github.com/typeveron/todoapp with the issue.

Alright, so I can see all commits with git log.

Which operating system do you use?
Did you change something in your configs, e.g. the .bashrc file?
Can you show us your .bashrc file? (after removing sensitive data)

My operating system is big slur which is unix based. I opened my .bashrc file but there is nothing in it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.