Tuesday, January 3, 2012

Git for Windows


I was looking for a version control system that runs on Windows recently. Git seemed to be a very good candidate. It is a distributed system which works very well and naturally on a standalone machine. The Windows flavor is called msysgit. I downloaded the portable version of it. It is packed by 7zip and does not require installation. Just extract the files and folders to a new folder you want. Is that what people call Green Software? I love that. No need for the Administrator privilege and the worry of messing up the Windows system.

After the extraction, there are two batch files. One is for the Linux users and the other is for the Windows users. Running the batch for the Linux users opens up a terminal with a Shell-like working environment. You can even use Vim in it. That is amazing. It is not obviously how to access the files on the harddisk. I played with it for a moment and found out cd /c would bring you to the root of disk C:.

Then you go to where your source code locates and run git init to set up a repository. Git creates a hidden directory .git there. It holds all the version information for your project. By running git add and then git commit, you have done the first submission of the project. git diff can find out what have been changed. But Git also has a strange taste to provide another command git whatchanged to show the differences between commits.

No comments:

 
Get This <