Tech and Digital Media

Monday, October 3, 2022

[New post] What does cherry-picking a commit with Git mean?

Site logo image Ganesh posted: " Cherry picking in Git means to choose a commit from one branch and apply it onto another branch directly. Example: This is in contrast with other ways such as merge and rebase which normally apply many commits onto another branc" Tech mastery

<a href="https://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean">What does cherry-picking a commit with Git mean?</a>

Ganesh

Oct 3

Cherry picking in Git means to choose a commit from one branch and apply it onto another branch directly.

Example:

This is in contrast with other ways such as merge and rebase which normally apply many commits onto another branch.

  1. Make sure you are on the branch you want to apply the commit to. git switch master
  2. Execute the following: git cherry-pick <commit-hash>

N.B.:

  1. If you cherry-pick from a public branch, you should consider using git cherry-pick -x <commit-hash> This will generate a standardized commit message. This way, you (and your co-workers) can still keep track of the origin of the commit and may avoid merge conflicts in the future.
  2. If you have notes attached to the commit they do not follow the cherry-pick. To bring them over as well, You have to use: git notes copy <from> <to>

Additional links:

  • git official guide page
Comment
Like
Tip icon image You can also reply to this email to leave a comment.

Unsubscribe to no longer receive posts from Tech mastery.
Change your email settings at manage subscriptions.

Trouble clicking? Copy and paste this URL into your browser:
https://technicalmasterblog.wordpress.com/2022/10/03/what-does-cherry-picking-a-commit-with-git-mean/

Powered by WordPress.com
Download on the App Store Get it on Google Play
at October 03, 2022
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

[New post] ‘Everyone Is Freaking Out’: Disney Explores Sale of ABC Network and Stations Amid Financial Challenges

...

  • [New post] Xiaomi’s Mi Smart Band 6 NFC is finally available in Europe officially
    Tech News For Today posted: "Xiaomi's Mi Smart Band 6 NFC is finally available in Europe officially At Xiaomi's bi...
  • [New post] ‘Everyone Is Freaking Out’: Disney Explores Sale of ABC Network and Stations Amid Financial Challenges
    ...
  • [New post] Asus is recruiting Android 12 beta testers for Zenfone 8
    Top Tech posted: " The Zenfone 8 announced in May with Android 11 already got a couple of Android 12 beta builds, but those...

Search This Blog

  • Home

About Me

Tech and Digital Media
View my complete profile

Report Abuse

Labels

  • 【ANDROID STUDIO】navigation
  • 【FLUTTER ANDROID STUDIO and IOS】backdrop filter widget
  • 【GAMEMAKER】Scroll Text
  • 【PYTHON】split train test
  • 【Visual Studio Visual Csharp】Message Box
  • 【Visual Studio Visual VB net】Taskbar properties
  • 【Vuejs】add dynamic tab labels labels exceed automatic scrolling

Blog Archive

  • September 2023 (502)
  • August 2023 (987)
  • July 2023 (954)
  • June 2023 (1023)
  • May 2023 (1227)
  • April 2023 (1057)
  • March 2023 (985)
  • February 2023 (900)
  • January 2023 (1040)
  • December 2022 (1072)
  • November 2022 (1145)
  • October 2022 (1151)
  • September 2022 (1071)
  • August 2022 (1097)
  • July 2022 (1111)
  • June 2022 (1117)
  • May 2022 (979)
  • April 2022 (1013)
  • March 2022 (982)
  • February 2022 (776)
  • January 2022 (681)
  • December 2021 (1197)
  • November 2021 (3156)
  • October 2021 (3212)
  • September 2021 (3140)
  • August 2021 (3271)
  • July 2021 (3205)
  • June 2021 (2984)
  • May 2021 (732)
Powered by Blogger.