pamiętnik programisty

06 lis, 2011

git cherry-pick is awesome

Zamieszczony przez: pejotr w: Inne|Linux|Programowanie

git cherry-pick logo

GIT

Today I used git cherry-pick command for the first time, and I am really impressed. In my current project I’ve few branches, just for fixing/delopment. There are also a few common files like documentation, TODO – simple text files. Sometimes I came up with a genius idea and I want to put it in TODO file just not to forget. The problem is that I can’t guarantee that I will be working on 'master' branch at that time. Using cherry-pick I was able to update ‘master’ branch just with this one commit from other branch.
One might say that instead of using cherry-pickI could first switch to ‘master’ and made a change. But this have to be done immediatly, while cherry-picking can be deferred in time:

$ git checkout master
$ git cherry-pick -x aac5f43

where „aac5f43″ is a part of commit SHA1 that should be picked. Commits information can be retrived using git log command.

Brak odpowiedzi na "git cherry-pick is awesome"

Formularz komentarza

*

O mnie:

pejotrWitam, nazywam się Piotr Doniec, w internecie występuję pod nickami 'pejotr' oraz 'doniczek'. Obecnie jestem studentem 3 roku informatyki na Politechnice Warszawskiej na wydziale Elektroniki i Technik Informacyjnych.

Kategorie