.gitignore file recommendations for Inform Project

I noticed that one of the proposals for a future version of Inform is Automatic gitignores for Inform projects. Very cool.

In the meantime, I am finally moving some of my Inform projects to Github and I need to manually set up my .gitignore file.

Does anyone who has worked with an Inform project in a git repository have recommendations for what files/directories to ignore? Or perhaps a sample .gitignore file?

Appreciate any help.

2 Likes

In the past, I’ve used these gitignore rules:

*.inform/Index
*.inform/Build
*.inform/Metadata.iFiction
*.inform/Skein.skein
*.inform/Release.blurb
*.materials/Release
.DS_Store
2 Likes

Yup, that makes sense. Thanks for the assist.

Hmm, this is interesting! This may be better in a new topic, but the way I do things is to have a /games/inform folder for all my projects.

I feel like I’m missing something obvious here, but I’m wondering how I would put, say, “only” /games/inform/project-1.inform and /games/inform/project-1.materials into a directory.

(The way I do it now is to just make a new project, then copy each file over to users/andrew/github/project-1/ and put in symbolic links where they were. This seems a bit awkward, but it also circles around gitignore. However, I feel I could be more efficient, and it looks like I’m missing something others are doing a lot of.)

Basically I just make an extra subfolder in the Projects directory for each project, so I have something like this:

C:\Users\adrian\Documents\Inform
  + Projects
    + game-a
      + Game A.inform
      + Game A.materials
      + .gitignore
      + game-a-cover.psd
      + story-notes.txt
      + whatever else I want to store alongside the project
    + game-b
      + ...
1 Like

I generally do my .gitignores like this:

*.inform/*.*
*.inform/Build
*.inform/Index
*.materials

Note that (a) I don’t usually use extensions. When I do, I definitely want the extensions included in the git repo, so it makes sense to use *.materials/Release as the last line instead.

Also, (b), I generally put uuid.txt and Settings.plist in the repo (despite the .gitignore). If I check out a new copy of the project, I want to keep the same IFID. Settings don’t change much but it is data, so might as well keep it.

(I guess notes.rtf is also data, but I’ve never used it.)

2 Likes

yeah, for git you definitely want a project parent directory over the project.inform and project.materials directories.

This makes so much sense! I suppose the (x.inform/x.materials) name doesn’ t matter then.

Though when I first created my directories I just sort of put everything in /games/inform.

Though I suppose it would be possible to, say, move over /games/inform/a.inform symlink to /users/andrew/github/a/source and /games/inform/a.inform symlink to /users/andrew/github/a/materials and then sync them.

This may apply more to me than in general, and it may have other possibilities, but I guess it’s a decent enough workaround for those who want to keep all .inform/source directories as siblings.

Part of inf7’s project creation makes a bunch of symlinks from the parent directory, principally

project.ni → project.inform/Source/story.ni
project.inf → project.inform/Build/auto.inf
project.ulx → project.inform/Build/output.ulx
extensions → project.materials/Extensions

and then I’d pretend the whole .inform/.materials arrangement didn’t exist (but I stopped short of making the .inform and .materials dirs hidden).

1 Like