Thoughts On Version Control?

Hello, I never been in professional programming field.
Hence, I am using my common sense to do this, it might be laughable but I want to learn how do you guys do it as one man developer or working with small team like less than 5 people.

These are what I do so far.

  • Make change logs on a .txt file.
  • When there’s update to framework or I add new feature, I start a new version.
    (For example, Version 0.00 to 0.01)
  • To back up previous project, I export them as Unity Package.
  • Rename current project folder to reflect the current version.

I wonder if I’m doing it wrong. ^^"

Subversion, Perforce, Git, Plastic etc. They’ve already solved the problem for you.

1 Like

For easy start, check also: Bitbucket + Sourcetree

6 Likes

I was going to ask if I could use TFS for version control for Unity projects, but then realized that I’ve done with Unity.

+1 for that.
For my current project, that has been a winning combination.

2 Likes

I only need it to be offline for now.
I’ve pay a visit to bitbucket, the seems good.

Even if you don’t need it to be online, that’s usually the easiest way to go.

If your hard drive dies a fiery death, will you have a backup? If so, how old?

Git, Git, Git, Git, Git.

And uh… Git. :slight_smile:

Git does work offline too, if you don’t want to pay for a private github repo, although it’s well worth the money to have a copy of your work safely stored somewhere.

I also heartily recommend SmartGit/Hg 6 as a graphical client. It takes much of the obscurity of working with git through commandline away. That log screen will quickly become your best friend.

Also, if you have two hard drives, you can set up a clone of your repo in the second drive, and set up the first repo to target that as a remote (as if it were github). Then every time you push, you’ll be automatically backing up your work on a second disk.

As someone who had a 500gb HD bum out on me not very long ago, I can’t stress enough the importance of never trusting a single storage device with irrecoverable stuff.

Cheers

I like Git, but I think for beginners (or converts from SVN or CVS) TortoiseHg is easier to use and has basically the same features. “Create new repo here” and then “commit” to it, done. I think the terminology in HG/Mercurial is easier to understand than that of Git initially because it is nearer to what people already know.

At least in earlier releases TortoiseGit had some strange behaviors (e.g. if you mixed up order of pull/push/commit you could easily create a corrupted repo (should be fixed I hope, there were long discussions on dev list about warnings printed until somebody said: ehm, operations that corrupt the repo should not print a warning, they should not be allowed)).

I come to a decision on using Bitbucket and SourceTree for git type repo.
Though I have problems with creating .gitignore files on my Macbook Pro.

You can create them in sourcetree (or the git client), or just from the command line or text editor. What kind of problem are you running into?

I’ve been using TFS 2013 with Git, works great and I especially love how TFS makes the SQL side so easy to deal with.

but, directly in Unity to Git?.. I have yet to explore that, I’ve been using SourceTree to manage outside of both Visual Studio and Unity.

(also note)
there’s a free version of TFS that limits account to like 5 I think…

Hi!

There are a ton of good suggestions above. As you have opted for git you might look at this: Unity GIT Ignore · GitHub

It will help you set up Unity and your .gitigbore file for use with a git repo.

If you have any questions just ask!

Cheers,
Ward, Unity

Okay, I got a little confuse here.

How do I actually set them up for git repo?

This is what I’m doing.

  1. Create a repo at Bitbucket.
  2. When I try to create a Unity project it’s says it can’t because the folder with the same name already exist. It asked to replace the whole folder.

I don’t understand that, so I try to clone some repo from Github and I successfully clone them but I found out that the cloned files suppose to be inside the Assets folder.

So, I delete that repo and create a blank Unity project.
Change the editor settings and clone that repo again, but point it to be inside the Unity Assets folder.

I created a new branch for me to work, then open Unity.

It works.

But I still don’t understand how to create a new one for myself.

Should I create the project first or what?
Then if I want to start version control on existing project on my HDD, how do I commit?
Do I copy all files and folder inside Unity project but from my observation, most Unity project repo at GitHub only present all those files that suppose to be inside Assets folder only.

Thank you in advance.

When I started using git, I started it with an empty project, then dragged in all the project’s files.

You mean, you started a repo.
Then clone it into your computer.
Then drag everything inside the root folder of your Unity project, and commit?

Yes, that’s what I did.

So, this is how it suppose to look at the master?

1754468--110981--Screen Shot 2014-08-30 at 1.50.40 AM.png

For version control it has to be git, making manual backups is just painful, as it requires you to trawl through release notes to find changes, where as with git you can clearly see changes in each file, from commit to commit. I run a gitlab on a server, which is like an open source version of github, and I use the github client side.