0

Creating a remote GIT repository

Posted by jason on Dec 20, 2009 in Ubuntu

Clean, readable code is one of my highest goals when writing code.  I’m always thinking about the next guy, even when the next guy is just me, several months from now.   Nothing is worse than going into spagetti code and not knowing what the heck is going on.  Because of this, I like to refactor my code A LOT.  When you are using source control, you never get yourself into situations that you can’t get out of.  It’s also nice to go back and see how the code has evolved over time, to see why certain files were changed.  Because of all these benefits, I use source control even on my own tiny projects where I’m the only developer.

I have used visual source safe when I first got started and like all vss users, quickly moved away from it.  I’ve spent most of my career using perforce for work.  I tried out Subversion a long time ago, but I got tired of my database getting corrupted and having to drop to the command line to repair it.  I used a very early version of subversion and I hear that it is MUCH better now.  Anyway, I used perforce for my personal stuff because the first two clients were free.  Since I’m learning everything else, why not throw in GIT too.  It’s gotten a lot of press so I want to see what the fuss is all about.  Here is how I installed my first GIT repository on my ubuntu server.

ssh to the remote box and type the following commands:

sudo apt-get install git-core
sudo mkdir /var/git
sudo mkdir /var/git/snowcaptech.git
sudo chown jason /var/git/snowcaptech.git
sudo chmod 775 /var/git/snowcaptech.git
cd /var/git/snowcaptech.git
git init --bare --shared=group

What we are doing is creating an empty directory in the /var/git folder where I like to keep all my git repositories.  We are then changing the owner to me and setting permissions for me to write and everyone else to be able to read.  The git init –bare creates a repository without a working copy.

then to add a project from your local client to the remote repository, you would first tell GIT about your project by going to the directory of your project and from a command prompt typing:

git init
git add .
git commit -m "initial checkin"

This initializes your repository and commits it to your local GIT repository.  This is all you need to do to have a working source control system for just yourself.

I like to make my source available on a server so I can access it from anywhere on the planet.  I never need to do this, but it is cool to be able to do this.  In order to “push” your local GIT repository to the remote repository, you have to tell your local repository about the remote.  Sorry if that was confusing.  Read it a few times. :)

git remote add origin jason@dev.snowtech.com:/var/git/snowcaptech.git
git push origin master

As long as your settings are all correct, your repository should now be at the remote repository.

 
0

Windows Mobile Smartphone vs Pocket PC

Posted by jason on Dec 20, 2009 in Mobile Devices, Windows Mobile

I recently encountered an issue where a Windows Mobile 5 application I wrote wasn’t working on a Windows Mobile 6 smart phone.  This particular phone was in Spain so I was not able to hold it in my hands.

Initially I believed it was because I didn’t have the Windows Mobile 6 SDK installed.  I needed the app to be backward compatible to Windows Mobile 5 so I haven’t messed around with the new SDK yet.  When I looked (skimmed) through the documentation, everything led me to believe that most windows mobile 5 apps will run on a Windows Mobile 6 device.  There is the exception that if you are using undocumented APIs, they aren’t guaranteed to work.  Since the app I’m working on logs GPS coordinates in the background, it was possible that I was using some calls through a 3rd party library.

Turns out my problem was much more basic.  Once I got my hands on an actual Windows Mobile 5 smart device to test on, I discovered the problem right away.  The app was failing when it tried to create a list box.  My simplistic thinking was that you write applications for “Windows Mobile 5″.  You actually write for either Windows Mobile Smartphones or Windows Mobile Pocket PCs.  One is more limited than the other.  The naming is still confusing to me.  My iPhone is a “smart phone” so I assumed that Smartphone was simply Pocket PC + phone.  WRONG.  Windows Mobile 6 makes it even worse.  They label one sdk “standard” and the other “professional”.  I am pretty sure professional = pocket pc = more functionality.

So I learned that if you want to write lowest common denominator applications for Windows Mobile, you need to target the smart phone.  And you should really test your interface at different resolutions because those smart phones have tiny screens.

Copyright © 2010 programming with passion All rights reserved. Theme by Laptop Geek.