I started to use git and GitHub to keep track of changes I do for an adventure I’m working on. As git repo, I chose the root directory, so <adventure-title>.inform.
To avoid that I upload big files to the remote repo, I ignore them using .gitignore.
So far so good. Now every time I am in my terminal to prepare commits while I am making changes in the inform 7 editor, there seems to be some kind of conflict when I enter git commands. I always need to leave the directory, and enter it again to make it work:
$ git status
fatal: Unable to read current working directory: Operation not permitted
$ cd ..
$ cd text-adv.inform/
$ git status
On branch my-branch
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: Metadata.iFiction
modified: Source/story.ni
I work on a Mac with a terminal, and use inform7 in parallel. Any suggestions?
When the Inform IDE saves, it creates a new project.inform directory and then replaces the previous one with that. So your .git info in project.inform is being destroyed.
To avoid this, create a parent directory to be the repository, and put project.inform inside that.
Then git-ignore everything in the project.inform/Build and project.inform/Index directories. You may or may not want to ignore Skein.skein as well – it’s large, but if you rely on the Skein feature you may want to track it.
Whoops – I am wrong about the IDE destroying extraneous files in the .inform directory. But if your shell is in that directory, it gets confused – that’s what you’re seeing.
The solution is still to have a parent dir as the repository.
(You want that anyway for other reasons. You may want to track some files in project.materials, for example.)
You might like to look at Counterfeit Monkey’s .gitignore. The lines beginning with “tools” won’t be relevant, but everything else should be generally applicable to Inform 7 projects.