Day138 — cherry pick in Git

Jacky Tsang
1 min readJan 6, 2020

--

Cherry pick is picking the whole file to the new branch.

If the commit you are picking has changes in one file, the whole file in the commit will be applied to current version of the file in the target branch. Thus, although some prior changes made to that file are not indicated in the commit, they will be included in this cherry pick.

history of git repo:

  1. Commit 123456 — make change A in File F (1st commit)
  2. Commit 234567 — make change B in File F (2nd commit)

If I pick commit 234567 to new branch, I will include the change made in previous commit 123456 to File F because I am cherry pick the whole file, not just the change B solely made in commit 234567.

--

--

No responses yet