Tuesday, January 7, 2014

Git and DropBox - An Approach for Small Projects and Small, Distributed Teams

I work on any number of software development projects and over the years have worked my way through any number of source control systems: RCS, CVS, SVN, until now (finally) I've landed on GIT.

Although GIT can be used with only a local repository, I always set it up on a remote repository, basically for two reasons: to have a backup in the event something happens to my computer, and to share the code with other developers, or even with another computer of my own. For some projects, we've created a GIT repository on one of our servers. For others, we've used GitHub, which is fantastic, IMO.

Creating a project repository in GitHub is perfect for projects that are being developed for public access and use, but to create a private GitHub project requires a paid-for account. And while the cost is not huge (~$8/mo at this writing), it would be nice to have an alternative, cost-free option. Enter DropBox.

I use DropBox all the time for transferring files between people and even between multiple computers of my own. It's just too easy. And on most projects in which I'm involved, the whole team uses DropBox to share files. So wouldn't it be cool if I could simply create a GIT remote repository in DropBox and share that with the development team? Yeah. So what we'll do here is set up a "bare" GIT remote repository under DropBox and then use that to capture a project's code. Importantly, this is a bare repo - it's not meant for any developer to commit to directly. Instead, developers should clone from this repo, commit locally, and push back to it.

So here's what I did:


  1. Download and install GIT (http://git-scm.com/downloads).
    While this includes some GUIs, I use the command from a terminal. So after installing, open a terminal or a command window and...
  2. Create a directory in DropBox for the repository. I used git_repos. Then cd into that.
  3. Initialize a git repository:
    git init --bare myproject.git
    You should see a message something  like this:
    Initialized empty Git repository in .../Dropbox/git_repos/myproject.git
    And you should see a DropBox notification of this as well.
And that's it. The bare GIT repository is created. if you look in the myproject.git directory, you'll see all the GIT folders and files.

Now, we can create or add a project to this repo using normal GIT commands:
cd 
git init
git add .
git commit -m "initial GIT commit"
git remote add origin 
git push -u origin master
The URL is important. It needs to point at that new DropBox repository, something like this:
d:/DropBox/.../git_repos/myproject.git 
This value will get written into the .git/config file in the project directory and will be used as the location for the "origin" or remote GIT repository.

Other developers on my team can now clone from this:
git clone d:/DropBox/.../git_repos/myproject.git myproject
and so on.

Tuesday, April 17, 2012

Documentation has Little Value - Read the Code

Again, I got this from Jeff Atwood HERE. But I feel so strongly about this that I'm plagiarizing  and not just linking to his page...

"... writing for people is way harder than writing for machines, the documentation will continue to suck for the forseeable future. There's very little you can do about it.
Except for one thing... You can learn to read the source.

No matter what the documentation says, the source code is the ultimate truth, the best and most definitive and up-to-date documentation you're likely to find. This will be true forever, so the sooner you come to terms with this, the better off you'll be as a software developer.

Nobody reads other people's code for fun. But we must read other people's code because we have to understand it to get things done. So don't be afraid to read the source.

Tuesday, February 21, 2012

Good Software is Hard to Create

This is copied nearly verbatum from a post by Dave Winer, HERE. But I found it so compelling the I'm not just linking to it, but stating it.


"... to make good software, requires lots of thought, trial and error, evaluation, iteration, trying the ideas out on other users, learning, thinking, more trial and error, and on and on. At some point you say it ain't perfect, but it's useful, so let's ship. That process, if the software is to be any good, doesn't happen in 24 hours. Sometimes it takes years, if the idea is new enough.

If you want an idea of an art that's like making software, look at film and food. It's got a lot in common with both. But there will never be a Julia Child of software. It's not an art where you can observe the creative process, because that goes on inside the creator's head. In that sense it's like film. And it's not a science, as some people seem to think it is. Good software makers are also joyous software eaters. We use the stuff, so we know when it's done because it's useful."

Thanks Dave!

Tuesday, February 7, 2012

MoDevDC 2/1/2012

I went to MoDevDC meetup last Wednesday night - two subjects were presented and both were (for me) very interesting. http://www.meetup.com/modevdc/events/48923902/?a=ea1_grp&rv=ea1

First was a presentation on PhoneGap by Andrew Glover of App47. 
I had been fooling with PhoneGap for a while now - mostly to see just how easy it would be to create a multi-phone app. I had not moved beyond the "HelloWorld" stage, but had gotten that deployed on both a Droid and a Blackberry. I figure that the iXX wouldn't be any harder. So I was very interested in this presentation. Here were my take-aways:

  1. PhoneGap is a framework for creating multi-platform apps. 
  2. It is designed for creating apps using javascript, HTML5 and CSS3.
  3. It provides a way to create a "shim" (my word) for leveraging a webkit browser on any mobile device. In the iXX world, this happens fairly automajically. In the Droid and other mobile worlds, I still have some file organization and a little coding to do.
  4. PhoneGap provides a seamless javascript API to some of the phone's features, such as the GPS, camera, accelerometer, and so on, so that my app will work across devices without having to change the way I access those phone functions.
  5. In addition to PhoneGap, I need a decent mobile javascript framework for my app. There are several such frameworks:
    • jQueryMobile
    • Sencha Touch
    • Appcelerator

Second was on HTML5 Caching by Ryan McGeary of BusyConf.
This was a very interesting discussion of the caching capabilities of HTML5 and how to use them to create an HTML app that could be downloaded and then used when offline. Most of the discussion was on the contents and syntax of the cache file and some of the "gotchas" that come from that. The material Ryan presented is from http://diveintohtml5.info/