When I check out a previous commit of a git repository, 'git log' no longer shows commits that were committed after the currently checked out commit.
So, the question is: how do get a log of commits after the currently checked out one?
Git Log Oneline The oneline option is used to display the output as one commit per line. It also shows the output in brief like the first seven characters of the commit SHA and the commit message.
Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command. It's the fastest and simplest way to get insight into which files a commit affects.
By default, with no arguments, git log lists the commits made in that repository in reverse chronological order; that is, the most recent commits show up first.
The --graph flag enables you to view your git log as a graph. To make things things interesting, you can combine this command with --oneline option you learned from above. One of the benefit of using this command is that it enables you to get a overview of how commits have merged and how the git history was created.
You can use the --all
flag to see all revisions, as in
git log --all
If you are just interested in the future revisions, you can also use
git log ..@{1} # assuming you just switched from the future master
git log ..abcdef # assuming abcdef is the newest future commit
The problem is: you don't know the children commits, only the parent comments.
And if you checkout directly a commit SHA1, you are in Detached HEAD mode (ie not on any branch).
One potential solution would be to list all the branches which contains your commit: "How to know which branch a “git log” commit belongs to?".
And then do a git log for each of those branches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With