Saturday 29 March 2014

Git Broke My Unity Project

I've been using Subversion (SVN) for source control for a few years but finally decided I needed to give Git a try.

For my purposes, working on my own, Subversion has served me very well.  I only decided to move because when I went to add an open source project to Codeplex it made it quite clear at every stage that SVN was not recommended and I got the feeling it was being depreciated out of existence.

It took me a while to get my head round Git and despite what the web sites claimed, I did not think that there are more choices of good Git clients than there are SVN clients.  That's just my opinion.

The Git tutorials emphasized it's de-centralised design, which for my purposes has little benefit.  I want a central master repository that holds the one version of the truth...  that's a discussion for another day.

The one command that the Git tutorials were fairly quiet about was the most important for me.  Push. After all the Add and Commit stuff is out of the way, Push uploads it to a server.  There is also the reverse Pull that I will need.

After having tried a few, the client I settled on was SourceTree.  It's written by the people who provide the BitBucket repository.  After I had used it a few times with GitHub I got to like it.  It has some handy options that make it easy for me to select the files, add them quickly and then commit and push in one easy action.

It was fairly easy to install but could do with a better getting started guide instead of some basic FAQ's.  I am not sure if it is necessary but I did need to read the instructions to create the SSH key:

I would rather not run two source control clients and I liked it enough that I have migrated my active projects.

Now for the one glitch.

All was fine to start with but then MonoDevelop v4.0.1 lost the plot!  This is the IDE launched from within Unity v4.3.  It would no longer recognise changes I made to classes, so the auto-complete functions stopped working and many sections of my code became coloured red!

The only change was that MonoDevelop had automatically recognised the Git source control and had started to use its Git Add-in.

It only took me a moment to decide that I needed to disable that.

Git add-in disabled, changes committed, Unity and Mono restarted and all was back to normal.

I am not a great fan of having everything built in to the IDE so it is no loss to me that I have had to disable the add-in.  I didn't even notice it was there until it went wrong.

Now I can get on and migrate more of my projects to Git repositories.


yuri said...

well too may steps :)

why not just export directly from blender? See for example

John C Brown said...

Hi Yuri
Your comment ended up on my GIT post so I am not sure what you are saying has too many steps!

Which post were you actually commenting on?