Image Posted on Updated on
We are into 6th day of the training and last day our instructor Kushal Das taught us how to use dig (a distributed version control system).
The start of the session seemed a little alien to me as I was clueless about it. Though after the sessions I did some poking around the internet, found a decent pdf to read on the same, actually the Git-documentation. Also found a history why Dig was created in the first place, I will probably write one post on the same. I also have an interesting documentary on the evolution of Open Source. Open source is all over all head 😛 . Anyways coming back to the session.
There were two sessions on Git, I am going to share few of the commands taught in the first session (the second session was post dinner and I am yet to work on that )
In the first session we were introduced to some basic commands of Git.
to configure git, set your user name and e-mail address. This is important because every Git commit uses this information. The commands are:$ git config –global user.name “Anurag Kumar”
$ git config –global user.email “firstname.lastname@example.org”
The names and the email address are to be changed as per the user.
Now that our identity is set,we were next asked to configure the default text editor that will be used by Git. Git uses the default editor, which is generally Vi or Vim. I was using geddit as a default so needed to add vim (you need to have vim installed in your system). The commands are:
$ git config –global core.editor vim
now to check the settings, you can use the command:
$ git config –list
This will show you a list all the settings Git can find at that point.
Now, since we are starting on a fresh note, we will make an existing dir and then import in to git:
$ git init
This creates a new subdirectory named .git (inside a dir called repo01) that contains all of your necessary repository files.
Next were asked to create a empty file (naming that as progress.txt) inside the same directory and then commit in to git.
$ git log
will show the commit details that were made earlier. Next we were asked to add another line in the same file and see the changes and difference
$ git status
This will tell us that some changes were made to progress.txt but they are yet to be committed.
$ git diff
This will then show us the difference of the added text.Next comes the commit part:
$ git add progress.txt
$ git commit -m “Adds a new line to the file”
$ git log
A commit message will inform about the commit made. Next some more changes were made in the file and the commit was done again. Few interesting doubts were raised which came in handy understanding the whole process. Usually I try to observe what others are asking and most of my doubts are cleared .
If by chance one is stuck wondering in Git, help feature will point right direction to them for:
$ git help <verb>
$ man git-<verb>
$ git help commit
I am yet to explore more of git and next sessions will be interesting. The documentation might help anyone who needs to look out for information.
It has been a while since we had started our training sessions and this year the number of students (more than 70) is surprisingly more as compared to the previous years. If I talk about the distribution of the attendees, we have people from US, Caribbean and of coarse from different parts of India. Majority of them are from West Bengal, a place where Kushal started his journey of FOSS.
The training is basically about Open Source and its technologies. In the starting we were given proper instructions as to how “communication is done” in the open source world. This was vital considering the fact that I am looking to get involved in it for a considerably long interval. However there is a thing that I would want to confess, at the start I do get a little nervous regarding proper communication. For I do not wish the person in front to get frustrated with me.
Nevertheless I am pity confident that I will overcome this anxiety as well, like I have being doing for the rest of the things in my life.
Getting back to the training, 2nd day saw the introduction to some basic terminal commands, the online tutorial for this can found here. It is indeed a good tutorial for new comers, however some of the examples are pity annoying and do not sync with the command definition. But then, what are Google and Stackoverflow for?
Next we were introduced to the vim editor and some commands involved in it. We will probably be using vim in our python coding exercises later. So, this is important. There are many commands regarding vim and it might take me some before i get used to it. Also, coming from a windows background, I have been using the graphical interface more that my keyboard and I have to improve that too.
(I will write a post on the open source platforms and my views regarding it some day.)
More about the training in the next post.