0

I have set some git options globally (not aliased) thanks to this thread, so that my git log shows --oneline by default.

Sometimes I want to see the expanded version to see the date of previous commits. How can I 'cancel' a flag temporarily? - or alternatively, what is the flag that shows the expanded view

Community
  • 1
  • 1
myol
  • 8,857
  • 19
  • 82
  • 143

3 Answers3

2

You don't need to "cancel" a flat set in the global or repository config.

Just specify the format you want using --pretty and the command line flags override any flag specified in the repository or global config.

For example:

$ git log --pretty=medium
axiac
  • 68,258
  • 9
  • 99
  • 134
1

You can override configuration options on the command line, e.g.:

git -c log.abbrevCommit=false log

In your case set

git -c format.pretty=short log

You can also bind this to an explicit command with a git alias for instance.

Martin C.
  • 12,140
  • 7
  • 40
  • 52
1

From the git manual,

--oneline
       This is a shorthand for "--pretty=oneline --abbrev-commit" used together.

Given this, if you look at the other options, we see that something like --no-abbrev-commit --pretty=medium should give something close to what you want.

Dezza
  • 1,094
  • 4
  • 22
  • 25