Because I want to be able to share the project between a couple of computers on different networks, I looked for a server where I can create a central repository - yes, I know, the strength and beauty of git is the fact that there is no need for this but I tried anyway. I discovered gitorious so I created a project there and pushed a portion of my local project to it - I don't want the entire project, because it contains Eclipse files and library jars that get created/installed when I create the project on a different computer.
From the other computer I tried to clone this repository (using git clone) but because the destination directory already existed I had troubles doing this. I kept digging for info about how to do this but couldn't find any (I'm sure it's out there and it was only my fault for not finding it). Finally, I got an idea: if git init creates a repository and git pull gets the code, why not try it this way. And it worked.
So, for my future projects that will be in this situation where I want to souorce control only a few files, what I need to do when moving to a new computer is:
- create the new project
- start git and cd to the project dir
- instead of git clone do: git init
- followed by: git pull git@gitorious.org:<project>/<repository.git>
- a RefCard from DZone
- Git posts at Getting Groovy
- GitMagic