Home | Webstore
Latest News: OOTP Update 20.8 - OOTP 20 Available - FHM 6 Available

All-Star Game sale, FHM 6 is 50% Off!


Go Back   OOTP Developments Forums > Prior Versions of Our Games > Out of the Park Baseball 17 > OOTP 17 - General Discussions

OOTP 17 - General Discussions Everything about the latest Out of the Park Baseball - officially licensed by MLB.com and the MLBPA.

Thread Tools
Old 08-14-2016, 12:19 PM   #1
Minors (Double A)
homerj's Avatar
Join Date: Mar 2016
Location: Pittsburgh, PA
Posts: 180
Thanks: 14
Thanked 81x in 49 posts
Backing Up Leagues with Git

Mentioned I used git to backup my leagues, and then it came up outside the forum about how I actually DO it, so I figured this would be useful to everyone, especially considering it will be MUCH easier to keep track of your backups, and save precious HD space.

I'm assuming using the commandline version of git here. There are several GUI based clients for all operating systems, but using them is an exercise for the reader. Everything here however will map to some option in a GUI client.

* assuming your league is in a League.lg directory

1) init the repo
Go into your league directory and type "git init". This will create a .git directory and let us use git to manage all the files.

2) Create your first commit
SAVE YOUR GAME. Type "git add ." in the League.lg directory, and it will add in all the files to be in your first commit. You can see these files with the "git status" command. It may give you several warnings about wanting to convert CRLF characters into LF. This is normal and can be ignored. Git wants everything as standard LF on its backend[Ed. Note: Windows needs to get with the program and use LF like everyone else]. After the files are stated, you can do "git commit -m "Insert useful message here" ". Useful messages could be "Opening Day 2016", "Changed MiLB playoff formats", "Want to see if I can trade for Joey Bag O'Donuts".

3) Create your next commit
So you've played a bit, and want another snapshot. You can go though the same procedure as above for your second commit. Stage the files with "git add ." and then "git commit -m "Another Message Here" ". It will only store the changes since the last commit. This means all those generated reports, generated facegen files, etc. etc. are only in once place. You've not going to have 30 copies of the same file every commit.

Reverting to previous versions
Ok, you went though, and now are like "something's screwy here with how I set this up, I want to go back". Well, every commit has an ID associated with it. So run "git checkout <SHA1 hash>" of the commit you want to go back to, then "git clean -f" to get rid of every file that wasn't a part of that commit—for instance, generated gamelogs, facegens, etc. Then you can go on with things from that spot, make new commits, etc. Note you can also just use the first 7 digits of the hash to refer to a given commit....well actually ANY amount of numbers as long as it's unique to the commit, but 7 is the standard for a short hash.

Starting game with your last commited state
You did a commit, then decided you wanted to just go back to your last backup. Exit the game, run "git clean -f" to remove all the new files that were generated, then run "git checkout ." to return your league to the state it was when you last did your commit. When you load the league again, you will be where you last did a commit.

There's a lot more stuff you can do with this, these aren't 100% the commands I use, I just wanted to post a "quick" little walk-though on getting started with using git to manage your league. I HIGHLY suggest you work with this with a test league first. Also nice if you want to use your favorite scripting language to automate some of this stuff. But this should be enough to get you started and get you running.

Last edited by homerj; 08-14-2016 at 12:23 PM. Reason: made commands bold, added "starting game with last commited state"
homerj is offline   Reply With Quote
2 thanks for this post:
BeanballComin (08-14-2016), TGH-Adfabre (08-14-2016)


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 07:31 PM.


Major League Baseball trademarks and copyrights are used with permission of MLB Advanced Media, L.P. Minor League Baseball trademarks and copyrights are used with the permission of Minor League Baseball. All rights reserved.

The Major League Baseball Players Association (www.MLBPLAYERS.com ) is the collective bargaining representative for all professional baseball players of the thirty Major League Baseball teams and serves as the exclusive group licensing agent for commercial and licensing activities involving active Major League baseball players. On behalf of its members, it operates the Players Choice licensing program and the Players Choice Awards, which benefit the needy through the Major League Baseball Players Trust, a charitable foundation established and run entirely by Major League baseball players. Follow: @MLB_Players; @MLBPAClubhouse; @MLBPlayersTrust

Out of the Park Baseball is a registered trademark of Out of the Park Developments GmbH & Co. KG

Google Play is a trademark of Google Inc.

Apple, iPhone, iPod touch and iPad are trademarks of Apple Inc., registered in the U.S. and other countries.



Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Copyright © 2018 Out of the Park Developments