In some small dev projects in the last months I was looking for a source control system. I liked to use Microsoft’s Team Foundation Services. But I was and I am not able to use them with my current VS 2010. I cannot use the final version (http://tfs.visualstudio.com) because of a bug in (my?) Visual Studio. (Forum thread related to this problem: http://social.msdn.microsoft.com/Forums/en-US/TFService/thread/1b6673ec-8c42-4896-9049-49f17b85bf65)
Anyway…
So I wonder if I could use Git. – It’s a “[…] a distributed revision control and source code management (SCM) system with an emphasis on speed.” (Source: Wikipedia).
There is GitHub.com where you can host public visible projects for free. For “private” projects you have to pay (https://github.com/plans). The pricing is fair! But I was looking for a cost opportunity.
For cloud storage purpose I’m using this cloud storage providers:
(For data protection on cloud storage I use BoxCryptor.)
For this article I use SugarSync.
In my scenario I have some source code to share between me and other project members. We like to code together. And we need some source control features… With a cloud storage provider I can share local folders with other people… So now:
My aim is to create a cloud storage based source code repository for a small project and share the repository with other developers to work on the same project. My aim *is not* to describe the basics of and the need for source control in software development. (And I do not describe why to do all the steps 😉 )
This are the step to do so:
- Download and install Git for Windows: http://code.google.com/p/msysgit/downloads/list: “Full installer for official Git for Windows 1.8.0 Featured Beta”
- Download and install Git Extensions: http://code.google.com/p/gitextensions/downloads/list: “Git Extensions 2.43 Windows installer”. This are some very usefull “GUI” extensions for Git.
- Download and install Git Source Control Provider for Visual Studio (2012, 2010, 2008): http://visualstudiogallery.msdn.microsoft.com/63a7e40d-4d71-4fbb-a23b-d262124b8f4c
- Download and install – if you like – PowerShell extensions for Git: https://github.com/dahlbyk/posh-git
- Register for a cloud storage, e.g. SugarSync.
- Download and install the cloud storage software on your dev machine and log in.
- Open Visual Studio and create your project as normal. Or open an existing project. It’s the same procedure in both situations.
- Right click on the project node or solution node in the Solution Explorer and click “Create Git Repository”
- Right click on the project and “commit” the changes.
- Open Git Shell (PowerShell or Bash), navigate to the project source folder.
Here you can see that to source folder is recognized as Git enabled folder.
- The next step is to create the connection to the repository that is shared between project members.
- Create a local folder for your Git repository and map the folder to your cloud storage.
- Create an empty folder inside the local repository folder. In this folder the project repository will be created.
- Open Git Extensions and create a new repository:
- Now you need to connect the local project folder with the repository.
- The next steps are to create a remote branch and to connect the local branch (“master”) with the remote branch
- Now you can use “git push” to upload local changes to the repository and “git pull” to download changes from the repository to the local project folder.
- The final step is to share the cloud storage hosted folder with other project members:
That’s it for the publisher.
The next step is that an invited project member needs to sync the repository folder to it’s local drive and do the following steps:
- I simulate this by creating a new local project directory “c:\source\test project 1 other member”.
- Then initialize the directory with “git init”
- Now you need to connect the local project folder with the repository.
- The last step is to set the local branch to “track” the remote branch.
That’s it, again. This are the basics about how to create a local project, a cloud hosted repository, how to share the repository and how to connect to it on a project members site.