Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make git-config to use spaces instead of tabs

Tags:

git

When I use git-config to edit my .gitconfig file, it inserts tabs. Is there a way to make it insert spaces instead of tabs?

(The motivation is that when I hand-edit the file, I always insert spaces. Git's use of tabs makes the file inconsistent. Of course I could just use tabs myself, but that's just ridiculous.)

like image 950
djordan Avatar asked Aug 24 '15 15:08

djordan


People also ask

What is ~/ Gitconfig?

gitconfig is used to store a per-user configuration as fallback values for the . git/config file. The file /etc/gitconfig can be used to store a system-wide default configuration. The configuration variables are used by both the Git plumbing and the porcelains.

What are the three levels of git configuration?

# There are 3 levels of git config; project, global and system.

How do I create a .gitconfig file?

Creating your global gitconfig file:From the Terminal, execute git config --global -e which will open up a text editor with the contents of the file (only if it has some content already, else it would be empty). You can then update the file with your custom configurations.


1 Answers

This was answered above in a comment by @Wolf, but to reiterate: this is hard-coded in Git's store_write_pair implementation, which was most recently rewritten in 2007 and originally implemented in 2005.

like image 62
dahlbyk Avatar answered Oct 25 '22 01:10

dahlbyk