Git workshop over irc

Date: 15th June
Venue: #wfs-india channel on freenode
Time: 6:30pm to 8:30pm IST
Registration: http://www.wfs-india.org/form/registration-form-git-workshop-june-15-2013

Git is, technically speaking, the most advanced version control system on earth right now. However this does not itself justify why everybody should learn it. The real value of git is that it has taken collaboration to a new level. Just like social media has made friendship cross barriers of space, git has helped developers work together across continents. Git is the backbone of developers working on huge projects like the Linux kernel. Git is also the choice of countless designers and can be used by visual artists and authors as well.

This amazing tool costs nothing — it is free.

Free to use and to modify as well (courtesy GNU-GPL V2). Nobody can stop you from becoming an expert in git.
Get started with Git through our workshop.

Pre-requisites
There is only one pre-requisite — install git beforehand.

Debian/Ubuntu

Install from the command-line using:

sudo apt-get install git

Fedora

Install from the command-line using:

sudo yum install git-core

Arch Linux

Install from the command-line using:

sudo pacman -S git

Windows

Download and install git from msysgit. You can use this direct URL to download the installer.

Mac

Mac users please use the instructions given here.

Still need help?

We will provide full assistance during the workshop for any issues faced by participants in installing git. We will assist participants in configuring their git installations before we begin. So if you are having troubles installing git, don’t worry. We’ll help you.

Particpants can ping anybody on #wfs-india to solve installation issues prior to the actual workshop.

http://www.wfs-india.org/p/git-workshop

Advertisements

Git is God – what to do if you’ve deleted a commit

You can accidentally delete a commit in many ways – yeah! that’s pretty easy – you just have to do one thing – not pay attention to what you are doing! And boom! you’ve deleted a commit.

In my case, I was rewriting my local commit history before sending a patch. I was using –

git rebase -i

I needed to delete an unnecessary commit but I accidentally deleted the commit on which I was working upon. That was a tight spot. I had 2 files full of changes!
So, now let me enlighten you on the power of Git.
You do a –

git fsck --lost-found

It will show a list of commit ids. In my case I had the commit id (by scrolling upward in the terminal) and it was there in that list of commit ids.
To be sure if that’s the correct commit, you can check it using –

git show 

Then I did –

git cherry-pick <commit_id>

I had multiple such dangling commits. Hence I used cherry-pick. You can get back your work through a lot of other ways – e.g. by using –

git rebase <commit_id>

or

git merge <commit_id>

“git rebase -i” – finally

As you have already guessed from the title of this post that I am a beginner in git. So far I was making do with basic pull, diff, add, commit commands in git. But when my mentor reviewed some 10 patches that I sent him and shared his feedback, he suggested me to get familiar with the following three as they were to be my “new best friends” when I incorporate his reviews in my code.

git commit --amend
git add -p
git rebase -i

Barring “git add -p”, the other two will help you to rewrite your commit history. I needed to squash some of the commits, amend nearly all the commit messages and amend some of the commits themselves to make necessary changes in the code based on the feedback from my mentor. Initially, I was very apprehensive about the whole thing. But you can trust Rewriting History chapter of the Pro Git book and get started.

Learning Git

I’ve used CVS and SVN during the 4 years that I worked in the software industry. Moving from CVS to SVN was a good experience. Now that I’m working on GeoIP and Wifi Geolocation server and client libraries with Gnome, I ‘ve started using git. This is my beginner stage and am going to keep a list of websites helping me to learn git. So here goes the list –

1. try.github.com will give you a basic understanding of git.
2. http://gitready.com/
Once you complete try.github.com training, you’ll get the following links –
3. http://github.com/training/online
4. http://git-scm.com/book
5. http://gitimmersion.com/
6. http://rogerdudler.github.com/git-guide/
To know ¬†about “git add -p” ( a very useful command )
7. http://johnkary.net/blog/git-add-p-the-most-powerful-git-feature-youre-not-using-yet/

If you by any chance bump into this page and find any good source for learning/mastering git, then please do share the URLs.