Tom Hale Tom Hale - 10 months ago 56
Git Question

How do I use a pager for long git add --patch hunks?

When I interactively add

hunks with
git add --patch
, I sometimes get hunks which are longer than the screen.

This is strange to me as I have already set:

pager = less -FRX --tabs=4

# Bypass pager: git --no-pager ...
diff = diff-highlight | less -FRX --tabs=4

What do I need to do to get add to use

Answer Source

Add to your gitconfig:

  add = less -FRX --tabs=4


  pager = less -FRX --tabs=4

  # " = true" means use pager defined in [core]
  add      = true
  diff     = true
  difftool = true
  log      = true
  show     = true