Monday, November 3, 2014

Git Rebase behind the scenes

Git rebase is one of the most recently used command if you are using git/githib for your version control.

To pull in from the central repository we use a

git pull --rebase

to rebase current branch to another branch we use

git checkout <branch1>
git rebase <branch2>


But many people don't know what exactly a git rebase is doing. So I thought I wouldn't I write down what I found. So here is an example


a -> b -> c-> d (master)
|             |
|             k (team2)
e -> f -> g (team1)

So I am in the branch team2 currently , and I want the changes of team1 in the branch team2. What would I do? obviously I would go for a

git rebase team1

What will be the end result?


The git log from team2 would print the below
a ->e -> f -> g -> b -> c-> d ->k

 Holy cow ! how did that happen?? That's what git rebase does , it will go up the hierarchy to find a common parent commit and then apply the changes from the branch to be rebased in this case the team1's commits. Then ontop of that all the commits from the current branch is re applied. So that is how rebasing is done.


Friday, June 27, 2014

How can she sit there Laugh and Look so beautiful

It was painful not to talk to her . I never told her that I liked her so much and I am sure she knows. But AM I ? Am I sure that she knows? No , the fact is I don't know anything about her, and that was the interesting part. I was talking to her at least for an hour every day since more than four years. I always thought what is it that  in her so that I never let her go . Some people are like that , they are just too close to heart that they could be torturing it real bad but its harder to let go because they have become an essential part of it alredy.