Are there ways to list the git log graph from all local branches only?
Consider the command:
git log --oneline --graph --decorate --all
Where the "--all" flag would be something like "--localbranchesonly".
Graph all git branchesDevelopers can see all branches in the graph with the –all switch. Also, in most situations, the –decorate switch will provide all the supplemental information in a formatted and nicely color-coded way.
The most basic filtering option for git log is to limit the number of commits that are displayed. When you're only interested in the last few commits, this saves you the trouble of viewing all the commits in a page. You can limit git log 's output by including the - option.
If you want to see the history of all branches/tags/etc., then you can use the --all shortcut. Git log doesn't just show 'the latest commits': it shows all commits that fit the given criteria, of which there are several dimensions. E.g., what branches is the commit on, is the commit in a particular range, etc.
Git Log OnelineThe 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. It will be used as follows: $ git log --oneline.
--all
means "everything in refs/
" (plus HEAD as well).
--branches
means "everything in refs/heads/
".
--remotes
means "everything in "refs/remotes/
".
--tags
means "everything in "refs/tags/
".
Except for --all
, they all take optional patterns that restrict the match even further.
As Josh Lee mentions, --exclude
can be used to limit the matches. There is also --glob
, which is like --all
in that it applies to all references, but like the others in that it accepts a pattern. Hence --branches=<pattern>
essentially means --glob=refs/heads/<pattern>
. Note that these are shell style globs, not regular expressions; and metacharacters in them may need to be protected from the shell.
git log --branches
will show everything under refs/heads
, which should limit you to all local branches. Doc for --branches.
You could also do git log --exclude=refs/remotes/* --all
, which is more complicated but will give you exactly what you're asking for.
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