This is what worked for me (note that, as @rasjani noted in the comment, there is no way to prevent git from inserting a tab primarily when using git config .)
Create filter
Create a filter to automatically convert tabs to spaces as soon as you do git add for the file. This filter is created.
git config --global filter.spacify.clean 'expand --tabs=4 --initial'
The expand command says that convert each tab character at the beginning of line to 4 space characters
Therefore, a filter definition includes both what it does and when it is executed (i.e. for which the git operation).
(On OSX, you will need to use gexpand after installing coreutils by doing brew install coreutils )
Of course, you will need to solve the area ( --system , --global or, by default --local ) above the configuration.
Specify the files / paths to which the filter will be applied
For example, for your repository, create .git/info/attributes with the following contents:
.* filter=spacify
This suggests that apply the spacify filter to any files that match the pattern .* Before these files are transferred to the repository.
Please note that the above only affects new files added to the repository. If you want this to be done for all existing files, you could either run expand manually or get git for it like this:
git config --global filter.spacify.smudge 'expand --tabs=4 --initial' git checkout HEAD -- **
Using the spacify filter for smudge will cause the filter to be applied to the checked files. After checking, you should see a bunch of changes in the dot files, in which the first tabs were converted to spaces. Repeat fixing these and henceforth smudge and clean duets should store your dotfiles without tabs!
Update - Stretch Request!
Here is the transfer request for your repo: https://github.com/raxod502/radian/pull/156