Investigating rules related to git, gitignore and the .data/ dir


Hi everyone,

I’m currently writing a blog post about the .data dir and am currently in a rabbit hole looking down into how git treats it and the way it may or may not be gitignored. The first part of my post is related to adding files into .git via both the editor and on the command line and how that interacts with when the app sleeps next … I’ve omitted all of this detail for the purpose of this question.

So my question is, I was looking for a .gitignore file to see if .data had been added to that but can’t find one. Nor can I find any $GIT* env vars to help me. So, I’m just wondering where the rule lives so I can document it. I’ll paste the relevant part of my (draft) blog post below so you can see where I got to and where I got stuck.

Many thanks.

One final thing I’d like to investigate is where the rule telling Git to ignore .data lives. Usually there is a .gitignore file at the top-level of the git repo:

app@ga-faq:~ 21:17 
$ pwd
app@ga-faq:~ 21:17 
$ ls -l .gitignore
ls: cannot access '.gitignore': No such file or directory

Nothing there. Perhaps there is something in the .git/config which gives us an indication of where this rule might live:

app@ga-faq:~ 21:18 
$ cat .git/config 
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        email = none
        name = Glitch (ga-faq)

Nothing of note there either (though there are some other things of interest which could be for a later blog post). So let’s check the GIT* environment variables. We can type echo $GIT and then press tab a couple of times for autocomplete to help us:

app@ga-faq:~ 21:19 
$ echo $GIT<tab><tab>

Alas there is nothing there to tell us, so for the moment I’m stumped.

Consider giving .data folder special treatment like .env

If you do a git config --list, you’ll see it:


Brilliant. That’s exactly what I was looking for. Many thanks @Tim.

I’ll try and finish my blog post in the next day or two and publish it.


I’ve finished my blog post. Thanks again @Tim.

Please let me know if you spot any errors, incorrect presumptions, or if you just have any plain old improvements or suggestions. :smile: