Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Git doesn't store diffs when you make a child commit of a work tree. Instead, it uses diffs to determine which files have changed, and then just saves those files wholesale.
Cherry-Pick, on the other hand, generates a diff of the changes by X commit relative to X-1 commit (its parent), and then immediately attempts to apply them to the current work tree (whatever is currently checked out).
If it fails, it drops you into a conflict resolution mode before continuing.
Then, once all errors are fixed (or if the initial "patch" (application of a diff) was successful), then it also creates a new commit with the same message and author information as the cherry-picked commit.
The end result is that you apply the changes a single commit made without doing anything with that commit's history (e.g. by a merge or rebase). This works even across unrelated branches.
It's the quasi-equivalent of:
git show COMMIT | git apply && git commit
Hope that helps. -
Also, welcome to DevRant. Solid first post :) Perhaps ease up on the emojis, though.
-
He explained the concept of cherry picking by cherry picking the concept he wanted to explain.
When I asked to Experienced Senior about cherry pick command in git.
I got 30 Minutes big lecture about Parent-Child Node.
But Cherry Pick, He did not pick for explain. 😡
rant