Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@afirth
Created March 12, 2014 02:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afirth/9499671 to your computer and use it in GitHub Desktop.
Save afirth/9499671 to your computer and use it in GitHub Desktop.
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