4

I have a bunch of branches and I'm trying to setup git so the default display is in columns. That is, I want the default to be git branch --column.

I tried defining an alias in my .gitconfig file: bc = branch --column but when I type git bc in terminal, it instead creates a branch called --column!! (sure was fun trying to get rid of that branch...)

I've also tried git branch --column=always but that just displays things in column format for that one specific instance instead of setting it to the default display.

I've tried reading the documentation and searching online but haven't been able to find an answer.

  • git help branch asked me to "See configuration variable column.branch for option syntax."
  • Google searching brought up this page on git-commands from tortoisegit.org but the section on column.branch says to look at the section on column.ui and column.ui just lists the available settings for outputting in columns.
Community
  • 1
  • 1
adilapapaya
  • 4,765
  • 3
  • 25
  • 26

1 Answers1

3

You can try (from git config man page):

git config --global column.ui always

Specify whether supported commands should output in columns

Note: git config --global alias.bc 'branch --column' should work too.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • That fixed it, thanks! The one thing I’m confused about is why `git config --global alias.bc 'branch --column’` worked when I typed it into terminal but not when I just opened my `.gitconfig` file and typed it in there. Any idea? – adilapapaya Jul 08 '15 at 15:15
  • @adilapapaya not sure: that is why i only modify a config file through a `git config` command, instead of directly modifying it manually in an editor ;) – VonC Jul 08 '15 at 15:20
  • @adilapapaya I haven't tested this, but with files like `.profile` and `.vimrc` you need to reload them for them to take effect in your current session. So maybe if you open your `.gitconfig`, edit it, and then type `source .gitconfig` to reload it? – A.Wan Oct 01 '15 at 19:18