Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
saving KSP save files with git
#this is only for OSX
#first, install git. http://git-scm.com/download/mac
cd ~/Library/Application\ Support/Steam/SteamApps/common/Kerbal\ Space\ Program/saves && git init
(crontab -l ; echo '*/5 * * * * cd ~/Library/Application\ Support/Steam/SteamApps/common/Kerbal\ Space\ Program/saves && git add -A && git commit -m "`date`" &> /dev/null') | crontab -
#confirm your crontab is good to go
crontab -l
##to revert
#quit KSP!!!
#use this if it's hung:
ps aux | grep "KSP.app" | grep -v "$$" | grep -v grep | perl -ane'kill -9, $F[1]'
git log ## find the SHA of the time you want
git branch `date +%s` <SHA>
#this will fork your git repo into a new branch (named after the epoch time right now) and check it out
#play your game
#don't worry, if you revert to the wrong thing you can always get back to it. git branch and then git checkout <branchname>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.