Skip to main content

Creating a Local Version Control System

Now this is a post that is going to be updated time and again.. The very post that made me abandon my previous blog to move on to a Google site..
Requirement:
Need to setup a local repository.. a version control system.. Given that I use VSS (I know, please dont make faces..!) at my work place, I am used to the 'ease'.. However it may be, it sure is simple to use...! I need the repository to be platform independent, as I dual boot into Windows 7 and Ubuntu, secondly need it to be local.. Now thats the background, next is a journal...

Which one to use?
Tried:
CVS: on Ubuntu 11.4 and on windows 7.. dint find it so impressive..
TortoiseCVS: Dont know why but the options in the context menu never appeared...! :S
Mercurial: confused about its use.. yet to be tried..
Trying out git.. many friends suggest this.. seems interesting.. simple to learn, they say.. lets see!

Git setup
Alright, what helped me understand it whole was two great articles, one form tiredblogger and another from a harvard site.
Do go through them both... (And you don't have to read this page any further! :) )

Rest is for my reference, for my own understanding..
It was simple to setup..
Download and install git from the ubuntu download center... Download and install git for windows from Google code project.. Done.. Both OS set.
In windows, left almost all settings unchanged during installation..

All I need to do is to create a bare repository to start with, its better they say.. so
in a new folder:
git init --bare
Then clone it into a new repo.. That's the working folder I guess...
so..
git clone <prev folder> <new folder name>
Done..
Then create and add new file to this new folder.. Thats the first source file..
Then, add it to repo..
git add .
Commit the repo..
git commit -a -m "a message"
Push the updates to the main repo, which would otherwise have been a remote repository, the original one from which the working was cloned.
git push origin master
Cool enough.. Lets try new things..

Working on multiple OS
The local repository cant be directly used from both the OS.. so What I am gonna have to try is to work as if I am 2 different persons contributing to a project.. haven't very well understood it all yet! lets see...!

Change only the origin url!

Alright.. Now, all I need to do is change only the path / url in the git config file for the head origin! Once done, the push was fine...! :) so...
Is there a way to avoid this manual work???
like having 2 origins? remotes I mean..
In manual it is said that the remote path can also be passed from a file in $GIT_DIR/remotes
But does that create new branches? If so, that'll clutter the repository unnecessarily...
lets see...


This post will be updated as and when I learn new things..!

Comments

Popular posts from this blog

Using Docker and a Private Registry with VPN On Windows

Wasn’t that a very specific title? Docker has a very good documentation and reading that alone is enough for most of the straightforward tasks we might want to do. But as always some practical tasks are not straightforward, hence this blog. What we are going to see here today is how to setup docker toolbox on a Windows machine, make it work even when VPN is connected, make it talk to a private, insecure docker registry (that is why VPN) and configure it so it can run docker compose and see how we can set this config as a one-time activity. That’s quite a mouthful, but yes this is what we are going to do. All ready? Let us begin then.

Install Docker ToolboxGo and download the docker toolbox and install it. That should create a shortcut called “Docker Quickstart Terminal”. Run it. That should show you an error about virtualization.

Enable VirtualizationRestart your machine, enter the BIOS settings and enable virtualization. It may be under advanced settings. On this Laptop, it is under th…

Yet another packager for node

Yet another packager for node There are so many packaging systems for node already, or maybe not as many, so here I am presenting another way to package your applications into an self extracting executable that has no dependencies. Ah well, a few dependencies, like the processor architecture, and Linux operating system may be, but that is all. What is it? It is a modified shell script originally used to create self-extracting and installing applications for Linux platforms. What it does is, it creates a tarball which includes your code, the modules it depends on, the specific node binary it uses, and appends it to a script with the command to execute your code. It is essentially a binary merge of the files, the shell script and the tar.This is not something new, people have used such a system in the past to deliver applications for Linux, every time you see an obscenely large ‘.sh’ file (for being that, a shell file) that can install or execute an application without requiring any ot…

Opinionless Comparison of Spring And Guice as DI frameworks

Recently I had to delve into the play framework for a particular microservice at work. Now it is not exactly new, nor is Guice, nor DI, but coming from Spring world it was still a big shift in approach. There is a lot of documentation comparing Spring with Guice, stating which is better, why and how. In general these articles discuss specific points where these two frameworks differ in their approaches and which approach seems better to the author. I am not sure these articles really help someone trying to take a dip in the other framework. We know the differing opinions, as they are stated by the authors of the respective frameworks in their own documentation as well, another person (article’s author) reiterating it with an incomplete comparison of these frameworks does not sound helpful. What would work much better is a direct mapping of features, without author’s opinion (Didn’t this sound like an opinion). That should help someone getting into Spring from Guice world or vice a ver…