Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git log: log of future revisions

Tags:

git

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?

like image 565
PlankTon Avatar asked Feb 20 '12 13:02

PlankTon


People also ask

What is git log -- Oneline?

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.

How do I see changes in git log?

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.

Is git log in chronological order?

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.

What does the command git log Oneline graph do?

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.


2 Answers

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
like image 133
phihag Avatar answered Sep 28 '22 18:09

phihag


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.

like image 28
VonC Avatar answered Sep 28 '22 17:09

VonC