Using GIT with Flash Builder 4 Part 1

Subversion has been my version control system (VCS) of choice for a long time now. However recently I have found myself leaning towards GIT more and more. In my opinion GIT is actually simpler than Subversion and not having .svn files littered all over the place is definitely life changing (maybe thats an exaggeration but it definitely makes thing a lot simpler). GIT is not as good at handling binary files (fla’s, swf’s and swc’s for example) as Subversion, but source swc’s shouldn’t change that often, and should you be storing the built output of your code in a VCS anyway?

This morning I found a new release of Flash Builder (build 271588) on the Adobe Prerelease site, and finally the standalone version supports 3rd party add-ons via the eclipse P2 update mechanism. Flush with the excitement of being able to use the standalone version for the first time in ages I decided to install it.

At this point I would normally install Subversive as my built in IDE VCS. When I started the LICS project I used GIT, but it was a bit of an ad hoc experiment and I had no formalised process – I still thought of subversion as my main VCS. But this morning was different, I felt it was time to officially jump ship and use GIT for all new projects. So instead of installing the Subversive eclipse plugin I went for EGIT instead. This is an eclipse plugin that allows you to work with a GIT repository and even push to a remote repository such as GITHub.

Here is what I did to start using GIT from inside Flash Builder.

Install Flash Builder 4.

I won’t describe how to do that here – its available here, and if you are using the Beta 2 you should use be sure to use the Eclipse plugin version because the Beta 2 standalone does not support 3rd party add-ons.

Start Flash Builder 4.

Click Help>Install New Software

Screen shot 2010-02-25 at 10.12.54.png

A dialog will popup

Screen shot 2010-02-25 at 10.27.42.png

and you need to click ‘Add’ to enter the download location for EGIT so click Add and then enter the name EGIT and the url http://download.eclipse.org/egit/updates

Screen shot 2010-02-25 at 10.14.13.png

Eclipse will query the download site and find the GIT plugin for you. Select the ‘Eclipse Git Team Provider’ Checkbox and click Next>

Screen shot 2010-02-25 at 10.16.21.png

Follow the screens through by clicking Next> and EGIT will install. You will need to accept the license agreement on the second screen and click finish

Screen shot 2010-02-25 at 10.18.10.png

Eclipse will do its stuff, and install EGIT for you. At one point it will ask you if you are alright with installing unsigned content; just click OK.

If everything went fine you will now have EGIT installed inside Flash Builder.

Create a new project (If you need to).

Please note that it is not necessary to create a new project in order to make it version controlled with GIT. If you already have a project you want to use GIT with then jump straigh to (7)

Screen shot 2010-02-25 at 10.40.11.png

Add Git Version Control To the Project

Right click on the Project name and choose Team>Share. A dialog will popup asking you which VCS to use. Choose GIT and click Next>

Screen shot 2010-02-25 at 10.41.56.png

Select your repository. Here you can just select the project you want and click ‘Create Repository’

Screen shot 2010-02-25 at 10.42.18.png

And Voila you newly created Flash Builder project is also a local GIT repository.

Screen shot 2010-02-25 at 10.42.46.png

In fact if you look at the contents of you project folder you will see that the .git directory has been added for you.

Screen shot 2010-02-25 at 10.50.22.png

You can now perform all of your normal GIT functions from within Eclipse.

A WARNING

You may have noticed that we didn’t have to contact a ‘GIT server’ in order to get this repository up and running. That’s because GIT is a distributed VCS and your repository is local. So a WARNING:

The repository you have created by this method is local to your machine and so is not backed up in any way. You can back it up normally by copying the project file stucture to a backup disk somewhere, but you can also ‘clone’ or ‘push’ your repository to another location. I will cover that in the next part.

Until you do one of these things this repository is the only copy of the work you have, so be careful.

In the next part I will link this project to Github for sharing and backup purposes.

This entry was posted in Development and tagged , . Bookmark the permalink.

2 Responses to Using GIT with Flash Builder 4 Part 1

  1. Pingback: DZ-015 - Using Git With Flash Builder 4 Part 2

  2. Pingback: Adding GIT support to Flash Builder | Jason's Blog

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">