Created
March 12, 2014 02:32
-
-
Save afirth/9499671 to your computer and use it in GitHub Desktop.
saving KSP save files with git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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