David Ebbo
David Ebbo

Reputation: 43193

Adding filter entries to the git config file

If I run:

git config foo.bar hello

It adds the following to my repo's local .git\config file:

[foo]
    bar = hello

But now suppose that I want to add the following to that same config (which is what's used by lfs, but that's beyond the point):

[filter "lfs"]
  clean = git-lfs clean %f
  smudge = git-lfs smudge %f
  required = true

Question: Is there a git command that will add this?

I have not been able to make git config work here, because the key would need to be something like filter "lfs".clean which it doesn't view as a valid key.

Upvotes: 6

Views: 4759

Answers (1)

mipadi
mipadi

Reputation: 410932

The command would be:

$ git config filter.lfs.clean 'git-lfs clean %f'
$ git config filter.lfs.smudge 'git-lfs smudge %f'
$ git config filter.lfs.required true

The part in quotes just becomes the second level of the config key.

Upvotes: 8

Related Questions