I was a huge fan of TortoiseSVN and was over the moon when TortoiseGit was released. So if you want to get started and you’re using Windows then hop on over to http://code.google.com/p/tortoisegit/ and get installing (actually one minor annoyance - before you do that you need to install msysGit http://code.google.com/p/msysgit/downloads/list).
Ok now using Git on one machine is cool and all, and if you are happy to have your repository public then there are plenty of free hosting sites. However none of them fitted my criteria of free, private and fast with an unlimited number of repositories.
Enter Dropbox. You probably know of the cloud storage solution (in fact there are others - SpiderOak looks particuarly interesting) and it is indeed very cool. But when you combine it with Git... way cooler than the sum of the parts. I use it mainly to share my project across multiple computers but you can also share the repository folder with other people.
Git with DropBox
- Create a new repository on your local drive (for example AwesomeProject27). Make sure you add at least one file and commit it.
- Create a folder in your Dropbox with the same name but extension .git (e.g. AwesomeProject27.git). This is simply following git convention.
- Inside that folder right click and create a repository and be sure to click the checkbox ‘Make It Bare (no working directories)’
- Go back to the repo on your local drive and right-click and choose Git Sync from the TortoiseGit context menu
- You need to setup a new Remote URL so click the Manage button
- In the Remote field add ‘origin’ (or some other name you like for the remote depo). In the URL add the full path to the folder you created in step 2 and you’re done, click OK.
- Select ‘origin’ in the Remote URL field and now click the Push button at the bottom. This will push your current committed changes to the DropBox folder.
Working without Git
You may be collaborating with some people who do not give a damn about version control systems. These guys may be awesome at what they do so hey I’m not going to complain! The best way I found to handle this is create a branch for them. Then when they want a drop of the game update their branch with a working build and send then a copy of the app. You switch back to your branch and carry on working. If they have some new stuff for you switch to their branch, copy their data onto the folder (check it still works of course!) and then commit it. You can then merge their changes into your branch. Make sure you Push their branch to the DropBox just in case your machine dies.
Most of these should be easy but I learned a little trick to export a clean copy of a branch which works from the Git command line. If you allowed msysGit to install its Explorer plugin then you should be able to click your repo and choose Git Bash. If not, run Git Bash from the Start menu and navigate to the repo. Say your branch is called 'simon' use this command.
git archive simon -o ..\AwesomeProject_Simon_20120123.zipThis will create a zip file of the current state of the current branch without any .git meta data. Archive creates an archive (duh) but if you actually want it in the unpacked form you can pipe the output into tar directly.
git archive simon | tar -xC ..\OutDirThatExists