Jump to content

ignore .git folder in saves

Recommended Posts

I have had problems in the past with corrupted savegame files, especially when using (and building) mods, so I now control my savegame files with git.

This creates a .git folder in the saves folder, which is picked up by the game as an "incompatible/invalid save". It's no problem as I simply choose "delete", KSP is unable to delete it, and I can play as normal.

The only problem comes if I choose ignore instead of delete, which locks up the client necessitating a restart.

I would think it would be a simple change to have the client ignore dot folders when looking for savegames. Thanks

Link to post
Share on other sites

I've always put the git repository in the KSP root folder, with a comprehensive .gitignore. This had the nice side effect of letting me also keep my mods and mod config files in version control, very useful pre-CKAN.

But yeah, ignoring dot files is probably a good idea.

Link to post
Share on other sites
  • 2 weeks later...
This creates a .git folder in the saves folder, which is picked up by the game as an "incompatible/invalid save".

To avoid that problem you could move your repository so it's not stored in the saves folder.

Run the following in the saves folder:

git init --separate-git-dir=../saves.git

This will move the .git folder up to ksp folder as saves.git/ and leave a .git file that links to the repository so the working dir is still connected.

I made a plugin called KerbalGit, that sets up a git repo for the saves folder and automatically commits on certain events.

Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...