Setting up Backup / Version Control Help Please

Yesterday I lost a big project. This is the second time I’ve lost a project. The first wasn’t important and small enough to rebuild easily. The last was a couple of months work. I’ve been busy cramming my head with learning Unity and didn’t want to add version control to my already stacked plate. But that mindset just bit me in the ass pretty damn hard.

I’ve spent the last several hours creating a BitBucket account, downloading SourceTree, and trying to set repositories. I’ve tried to follow the tutorial for BitBucket and SourceTree and I’m unable to complete either as I’m getting errors. In SourceTree, for example, I’m getting a bad url when trying to clone. There is a link to setup an account and I’ve done that and SourceTree is logged into my BitBucket account. I have no idea what to do next as I can only get so far into the tuts before I run into a situation I can’t correct.

Can somebody explain what magic needs to happen to make this work, I can’t afford to loose any more work and I can’t seem to setup things correctly, despite following the tuts step-by-step.

Don’t feel bad; git is hard. When all goes well, and with the help of someone more experienced, it’s not too bad, but sooner or later just about everybody runs into a broken git repo of one sort or another, and the steps required to fix it are arcane indeed. And even experienced git users are likely to be bitten by design flaws in core commands such as git pull.

But Linus Torvalds loves git, so it’s become popular. If you learn to wrestle it into submission, you’ll have a valuable skill that will make you a welcome team member on almost any project!

If you just want to get stuff done, I would recommend subversion, which is considerably simpler. I’ve been using it for years (decades?) and can’t remember ever running into the equivalent of a broken git repo. Setup is easy, and usage requires basically half a dozen commands which I’d be happy to lay out for you. (I prefer to just use it on the command line, though graphical clients do exist for it.)

But even easier than that might be simply a backup plan. If you have a Mac, buy a $80 external hard disk and run TimeMachine on it. That’s it — no commands, nothing to configure or administer. It just chugs away in the background, keeping copies of any file you change, ready to restore an older version when something goes sideways. If you’re not on a Mac, I’m sure there are similar systems for whatever you use. Or you could drag a copy of your project into DropBox each night when you wrap up (or make a script to do this for you).

(Personally, I use both — my whole hard drive is Time Machined, and almost all my projects are checked into subversion. But I do have lots of half-baked experiments, test projects, etc., which are not in subversion, and it’s a comfort to know that they’re hanging out on the backup drive all the same.)

Thanks Joe.

I am on a Mac and I do have a backup drive, that I manually do backups to, without versioning. I’ve had too many bad experiences with TimeMachine and no longer use it.

Had a look at Subversion. It was a trip back to the 90’s, what an archaic website! You said it was easy, but the first thing it wanted me to do was download a book (pdf) to learn subversion.

I just want to prevent loosing anything more. I don’t want to read books, manuals, or other materials that provide way too much information for where I am now. I’d like to go back to work but I need have an insurance policy before I can do that. Should it take nearly a day to set up something like this, that is assuming I’ll have something working in the next hour or two?

Should I start over from scratch? Far too many people are using this, what am I doing or not doing that they are? I’m struggling bad enough with learning Unity, Blender and other tools, I can’t take on one more one more load, it’s just too much.

The trickiest part of setting up for is often the initial connection to a remote repo. Here are the steps I normally take.

  • Create an empty local repo
  • Create an empty remote repo
  • Sync the two by adding the remote to your local
  • Set up the .gitignore
  • Copy your project into the local repo
  • Do an initial commit and wait for ever for it to sync
  • Run version control as normal.

Really? I’ve never had any trouble with it. I know it’s space-inefficient — it stores complete copies of any changed file, rather than deltas — but that also makes it more robust. And I like the idea that, if I want, I can just poke around in the file archive directly (though in practice, I always use the TM interface).

Well sure they do, but you don’t really need to do that. You basically need these commands:

  • svn co (checkout) just once, to check out a repo (hosted with, say, Deveo). This copies the (probably empty) repository from the server down to your local machine.
  • svn up (update) to update your local repo to match what’s on the server. If it’s just you, you probably don’t actually need this, but it’s a good habit to do this whenever you sit down to work anyway.
  • svn st (status) to see what local changes have not been committed. You’ll get a ? (next to any file svn isn’t tracking at all, an M next to any tracked file that’s been modified, and a D by any file that svn was tracking, but which is now missing.
  • svn add to add any new file you want to track (from those marked with ? in the previous step). And finally,
  • svn ci (checkin) to commit your changes, which pushes them up to the server after prompting you for a change comment.

That’s about it. If you read the svn book, it will go on at some length about making and merging branches, etc. But in practice you may never need to do that. Then there are a handful of other commands that are sometimes handy, like svn log to remind you of some previous commit comment, or svn cat to list some older version of a file (which you can then pipe to a file and compare to the current version with TextWrangler or BBEdit or whatever). But you can pick those up on an as-needed basis.

No, it shouldn’t take nearly a day. Brand new to it, it should take maybe an hour or two. I highly recommend letting somebody else actually set up and host the repo (Deveo is my current go-to for this), so all you have to master is the above half-dozen commands.

With git, you mean? Who knows? There are so many ways to screw up with git, I wouldn’t even begin to guess which particular landmine you have stepped on.

(But don’t think that everybody is using git without problems. That’s a myth. I’ve worked on a half-dozen completely unrelated team projects using git, with completely different people, and all of them have horror stories. “So why do you use it?” I ask, and they answer with something like “Because that’s what everybody else uses” or “Because it lets me commit my changes when I’m on a plane!”)

Well if that’s really the case, then I think you should give Time Machine another try. Perhaps it’s improved since the last time you used it. I wasn’t an early adopter — I just started using it a couple years ago, but it Just Works for me and requires learning no new tools.

Or, write a script to rsync your project to a folder in Dropbox, and let them do the versioning for you. (Just the Assets folder… in particular, don’t sync the Library and Temp folders, which are huge and unnecessary.)

[But if you decide you want to learn svn after all, PM me with any questions. I’ll even hop on your favorite chat app (I currently have Skype, Slack, and Discord running for different clients) and help you out in real time, when I happen to be online.]

For context @JoeStrout is a major advocate of simplicity in his tools. There is nothing wrong with this, just be aware his ideal of prefect has the minimum number of features to get the job done.

True dat.

Many thanks for the replies.

I’ve setup a small 80G drive and TimeMachine as a stop gap for now. One issue is TM has no white list, only a blacklist. Excluding everything but my project folder was a pain and it’s still backing up more than I need.

Still cant figure out what is wrong with BitBucket and SourceTree, they seem to be talking to each other. I’m in this a full day now. Joe, I chose Bitbucket because it seems to the goto tool for this. I did a bit of googling before making a decision. I’d really like to get this working, so I can get back to Unity. It’s going to take a while to get over the sting of loosing my project and I’m not comfortable proceeding without something in place to prevent this from happening again.

Hey BoardMormon, what do you mean in your step 7 ‘Run Version Control As Normal’. I’ve never used any version control before. Run what? Nothing about this is normal…

Step seven is just to hit commit and push in source tree each time you save. Nothing magical there, it sounds like you might be missing something earlier.

The initial setup for git is often a pain. But once it’s running it’s normally straight forward. (And in fairness I don’t donthe initial set up that often, so in may well have missed something on my list).

Thanks again to all.

Long story short… I’m on a Mac and SSH was disabled. SourceTree is a PC port to Mac and has a very poor error reporting system. Going through the logs I found SSH was the cause. Had a bitch of a time in the terminal to get SSH active and produce an rsa hash, which Bitbucket needs to enable remote access. Finished my initial project push about midnight last night. Think I might have set a record for the longest time setting up a functional repo. Not sure why everything I jump into is WWF brawl, just lucky that way…