Is it possible to add/initiate a new git submodule with the ignore option set to a certain value?

I have a script that sets up a project for me and my co-workers.
We are using git submodules inside our repository. The script I’ve made creates untracked config files inside the submodules’ directories (cabal’s sandbox config files to be more specific). I’m never going to modify the submodules, will never push any changes. I would like for those config files not to be listed as modifications to the repository, so I ignore them with the submodule option ignore = untracked. However, I have to do that manually for each submodule entry in the .git/config file.

The question at hand: is it possible to set that option per submodule when calling git submodule add or git submodule init? If not, is there any git command that would allow me to set such a config variable per-module after initialisation?

  • automated push to a github repo with travis
  • git: reliably switching to a detached HEAD and then restore HEAD later, all from a script
  • Is it possible to create branch that is tracking non-existing remote
  • Jenkins: Get build numbers range on a particular day
  • Automated Phing Deployment - Git Asking For Password
  • After git push or merge, how to update multiple remotes?
  • How to use Git with two differents repositories with and without ssh authentification?
  • How do I ask git, which commits are not on a branch?
  • Meaning of this git command's log
  • Accessing Github behind corporate proxy Node.js
  • Change an old commit and remove some changes
  • Fork repository in Bitbucket, keep fork delete original
  • One Solution collect form web for “Is it possible to add/initiate a new git submodule with the ignore option set to a certain value?”

    According to the docs there is no such option available for the add and init subcommands.

    However there is a git config command that allows setting that config option per submodule:

    git config submodule.full/submodule-name.ignore untracked

    Git Baby is a git and github fan, let's start git clone.