вторник, 19 марта 2013 г.

Google stats

It's fun to note that the most popular Google search request that leads to my blog is: 'is way to copy and'.

I cannot even imagine why would anyone with clear mind search for this phrase and click on git blog. But, according to Google Statistics, if somebody made his way to my blog from Google, then it's three times more probable he searched for 'is way to copy and' than for my main target 'git explained visually'...

четверг, 10 января 2013 г.

Git: cherry-pick vs rebase

When to use cherry-pick and when to use rebase?

Cherry-pick is a tool to merge a single isolated commit into your current branch.

Consider an example. Here we have two branches: master and topic-test. Our current branch is master.


If we happen to cherry-pick "change 2" commit, we are going to get only the changes introduced by "change 2" commit but not "change 1" commit because cherry-picking ignores history.


Rebase is way to "copy and paste" all commits from other branch on top of your current branch. Rebasing "change 2" above master results in:


Please note the difference: now the whole history was merged.

Both of theese operations are merges, so they both can result in conflicts which have to be resolved before continuing. Rebase processes one commit after another, so can result in many tiers of conflicts.