31 Mayıs 2021 Pazartesi

git cherry-pick seçeneği

Giriş
Açıklaması şöyle
It's a robust command and allows you to pick any commit from any branch and apply it to any other branch.
Örnek
Açıklaması şöyle
Cherry picking is a very powerful feature of git. It allows you to pick specific commits from one branch and merge it into another branch. So let’s say develop branch is 3 commits ahead of master, out of those 3, just 2nd commit need to be merged on master. Here is how you would handle this situation in git

Step 1: Checkout to the master branch
Step 2: Use git cherry-pick <commit-hash> to merge the specific commit to the master branch
Note: You can view all the commits you have made and their hashes by using the git log command

Now later on if you want to merge the rest of the develop branch with master branch simply run the following command:

git rebase develop
Örnek
Şöyle yaparız
$ git cherry-pick <commit-hash>
commit hash'i öğrenmek için git log seçeneği kullanılabilir.

--abort seçeneği
Örnek
Şöyle yaparız
$git cherry-pick --abort

Hiç yorum yok:

Yorum Gönder