šŸ•·ļø Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 39 (from laksa182)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ā„¹ļø Skipped - page is already crawled

šŸ“„
INDEXABLE
āœ…
CRAWLED
1 day ago
šŸ¤–
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://phoenixnap.com/kb/git-cherry-pick
Last Crawled2026-04-08 00:19:05 (1 day ago)
First Indexed2023-10-02 15:02:29 (2 years ago)
HTTP Status Code200
Meta TitleHow to Cherry-Pick from Another Branch in Git | phoenixNAP KB
Meta DescriptionThis step-by-step guide explains cherry-picking and shows how to cherry-pick a commit from one branch into another one in Git.
Meta Canonicalnull
Boilerpipe Text
Topics: Cherry-picking in Git is a useful operation that allows users to select and apply a single commit from one branch to another. It is an alternative to git rebase and git merge , which are used to apply multiple commits to another branch. This tutorial will show how to cherry-pick a commit from another branch in Git. Prerequisites Git installed (follow our tutorials to install Git on Ubuntu ,Ā  macOS ,Ā  Windows ,Ā  CentOS 7 , orĀ  CentOS 8 ). A Git repository . A separate branch with multiple commits . What Is Cherry-Picking in Git? Cherry-picking in Git is a process of choosing and applying specific commits from one branch to another. Through cherry-picking, users can extract one or several commits from one branch's history and apply them as new commits on a different branch. The process helps incorporate specific changes, such as bug fixes or features, without merging the entire source branch. Picking individual commits facilitates management and integrates changes granularly within a Git repository. When to Use Git Cherry-Picking? Use cherry-picking in Git to select specific changes from one branch and apply them to another without merging the entire branch. It is a great option for selectively incorporating bug fixes, features, or other changes from one branch into another. While cherry-picking is a valuable tool for selective changes, consider the context of your project and its potential implications on commit history, collaboration, and code dependencies. If there are possible negative implications of cherry-picking, opt for alternative Git strategies like merging or rebasing. The situations when you need to avoid using Git cherry-pick are: When changes depend on a series of commits . If the commit you want to pick depends on a series of commits in the source branch and cherry-picking them individually would break the intended functionality, merging or rebasing the entire branch is a better choice. Cherry-picking individual commits may result in the code not working as expected. When it disrupts branch integrity. Cherry-picking can disrupt the chronological order of commits in a branch's history. Avoid cherry-picking if it is crucial to preserve the exact branch history. When it duplicates commits. Cherry-picking can lead to duplicated commits if the same changes are cherry-picked into multiple branches. Doing so makes it hard to track changes and increases the risk of conflicts in the future. When it causes merge conflicts. Cherry-picking can introduce complex merge conflicts , especially when the same changes have occurred in the source and target branches. In that case, it is simpler to merge the branches instead. How to Use Git Cherry-Picking? To cherry-pick in Git, utilize the git log command to pinpoint the commit you want to cherry-pick. Then, cherry-pick the commit onto the target branch using the commit ID. Follow the steps below: 1. Find the commit ID by running: git log For this tutorial, we will cherry-pick the commit 71277daebbb157f7018a73e482e2379d9efceb64 (new file) from the master branch. Take note of the commit ID you want to cherry-pick, as you will need it later. 2. Switch to the branch you want to cherry-pick the commit to. The syntax is: git switch [branch-name] We will cherry-pick the commit to a branch named test-branch : 3. After switching to the target branch, cherry-pick the commit using the commit ID you copied from the log. The syntax for cherry-picking is: git cherry-pick [commit id] We will run the following command to cherry-pick the commit mentioned earlier: git cherry-pick 71277daebbb157f7018a73e482e2379d9efceb64 The command cherry-picks the specified commit from the master branch to the test-branch , adding a new commit in the branch history, as shown in the output of git reflog : Conclusion Git cherry-pick is a powerful and versatile tool that allows to selectively apply specific commits from one branch to another. However, make sure to use cherry-picking with caution and ensure that the changes you apply are appropriate in the context of the project to avoid conflicts and code inconsistencies. Next, see how to check out a file from another branch or learn to squash commits in Git . Was this article helpful? Yes No
Markdown
- [Call](https://phoenixnap.com/kb/git-cherry-pick) - [Support](tel:1-855-330-1509) - [Sales](tel:1-877-588-5918) - [Login](https://phoenixnap.com/kb/git-cherry-pick) - [Bare Metal Cloud](https://bmc.phoenixnap.com/) - [Admin Hub](https://admin.phoenixnap.com/) - [Partners](https://phoenixnap.com/partners) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/01-colocation-mobile.svg)COLOCATION](https://phoenixnap.com/colocation) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/02-colocation-plus.svg)Colocation Premier Carrier Hotel](https://phoenixnap.com/colocation) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/03-data-center-as-a-service.svg)Data Center as a Service Solutions for Digital Transformation](https://phoenixnap.com/colocation/data-center-as-a-service) - [Data Center as a Service Overview](https://phoenixnap.com/colocation/data-center-as-a-service) - [Hardware as a Service Flexible Hardware Leasing](https://phoenixnap.com/colocation/hardware-as-a-service) - [Bare Metal Cloud API-Driven Dedicated Servers](https://phoenixnap.com/bare-metal-cloud) - [Object Storage S3 API Compatible Storage Service](https://phoenixnap.com/object-storage) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/04-meet-me-room.svg)Meet-Me Room The Interconnectivity Hub](https://phoenixnap.com/colocation/meet-me-room) - [Meet-Me Room Overview](https://phoenixnap.com/colocation/meet-me-room) - [AWS Direct Connect Dedicated Link to Amazon Cloud](https://phoenixnap.com/colocation/aws-direct-connect) - [Google Cloud Interconnect Private Connectivity to Google Cloud](https://phoenixnap.com/google-cloud-interconnect) - [Megaport Cloud Router Simplified Multi-Cloud Connections](https://phoenixnap.com/offers/megaport-cloud-router) - [All Carriers Global Interconnectivity Options](https://phoenixnap.com/colocation/all-carriers) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/05-schedule-a-tour.svg)Schedule a Tour Guided Virtual Data Center Tour](https://phoenixnap.com/phoenix-data-center-virtual-tour) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/06-data-center-locations.svg)Data Center Locations Global Data Center Footprint](https://phoenixnap.com/colocation/data-center-locations) - [Data Center Locations Overview](https://phoenixnap.com/colocation/data-center-locations) - [Phoenix, AZ The Largest Fiber Backbone in the U.S.](https://phoenixnap.com/colocation/phoenix) - [Amsterdam, NL The Connectivity Hub of Europe](https://phoenixnap.com/colocation/amsterdam) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/01-bare-metal-cloud-platform.svg)BARE METAL CLOUD](https://phoenixnap.com/bare-metal-cloud) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/01-bare-metal-cloud-platform.svg)Platform API-Driven Dedicated Servers](https://phoenixnap.com/bare-metal-cloud) - [Platform Overview](https://phoenixnap.com/bare-metal-cloud) - [Infrastructure As Code DevOps Integrations](https://phoenixnap.com/bare-metal-cloud/infrastructure-as-code) - [BMC vs. Dedicated Servers Choose the Best Option](https://phoenixnap.com/bare-metal-cloud-vs-dedicated-servers) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/02-bare-metal-cloud-pricing.svg)Pricing Instance pricing and cost estimation](https://phoenixnap.com/kb/git-cherry-pick) - [Instance Pricing See All Configurations](https://phoenixnap.com/bare-metal-cloud/instances) - [Pricing Calculator Get an Estimate](https://phoenixnap.com/cloud-pricing-calculator) - [Network/IP Pricing Flexible IP Pricing](https://phoenixnap.com/bare-metal-cloud/ip-pricing) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/03-kubernetes-solutions.svg)Kubernetes Solutions Streamlined Kubernetes Management](https://phoenixnap.com/kb/git-cherry-pick) - [Rancher Deployment One-Click Kubernetes Deployment](https://phoenixnap.com/bare-metal-cloud/rancher-deployment) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/04-cpus.svg)CPUs Next Gen Intel Processors](https://phoenixnap.com/kb/git-cherry-pick) - [Xeon 6 6700-series with E-Cores Supercharge Cloud-Native Workloads](https://phoenixnap.com/bare-metal-cloud/intel-xeon-6-processors-with-e-cores) - [IntelĀ® Coreā„¢ i9 14900K Ideal for Gaming, Streaming, and Content Creation](https://phoenixnap.com/bare-metal-cloud/intel-core-i9-14900k) - [5th Gen Intel Xeon Scalable CPUs Boost Data-Intensive Workloads](https://phoenixnap.com/bare-metal-cloud/5th-gen-intel-xeon-scalable-processors) - [HPE Ampere Altra Q80-30 HPEĀ® ProLiant RL300 as a service](https://phoenixnap.com/bare-metal-cloud/hpe-proliant-rl300) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/05-alliances.svg)Alliances Technology Partnerships](https://phoenixnap.com/bare-metal-cloud/technology-ecosystem) - [Ecosystem Underlying Technologies](https://phoenixnap.com/bare-metal-cloud/technology-ecosystem) - [NetrisOS VPC networking on bare metal](https://phoenixnap.com/bare-metal-cloud/netris) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/06-storage-options.svg)Storage Options Flexible Storage Solutions](https://phoenixnap.com/kb/git-cherry-pick) - [Object Storage S3-Compatible Storage Solution](https://phoenixnap.com/object-storage) - [Network File Storage All-Flash Scale-Out Storage Resources](https://phoenixnap.com/network-file-storage) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/07-gpu-servers.svg)GPU Servers For AI/ML and HPC workloads](https://phoenixnap.com/kb/git-cherry-pick) - [Intel Max 1100 GPUs 1 system. 2 GPUs. Amazing performance.](https://phoenixnap.com/bare-metal-cloud/gpu-servers) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/01-hybrid-cloud-mobile.svg)HYBRID CLOUD](https://phoenixnap.com/security/data-security-cloud) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/02-hybrid-cloud-overview.svg)Hybrid Cloud Overview](https://phoenixnap.com/cloud-services/hybrid-cloud-solutions) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/03-object-storage.svg)Object Storage S3 Compatible Storage Solution](https://phoenixnap.com/object-storage) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/04-bare-metal-cloud.svg)Bare Metal Cloud API-Driven Dedicated Servers](https://phoenixnap.com/bare-metal-cloud) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/05-alternative-cloud-provider.svg)Alternative Cloud Provider Overcome Public Cloud Limitations](https://phoenixnap.com/cloud-services/alternative-cloud-provider) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/06-backup-solutions.svg)Backup Solutions Veeam-Powered Services](https://phoenixnap.com/backup-restore) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/07-disaster-recovery.svg)Disaster Recovery VMware, Veeam, Zerto](https://phoenixnap.com/disaster-recovery-as-a-service-draas) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/08-veeam-cloud-connect.svg)Veeam Cloud Connect Backup and Replication](https://phoenixnap.com/backup-restore/veeam-cloud-connect) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/09-managed-backup-for-microsoft-365.svg)Managed Backup for Microsoft 365 Veeam-Powered Service](https://phoenixnap.com/backup-restore/microsoft-365-backup) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/01-network-mobile.svg)NETWORK](https://phoenixnap.com/network) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/02-network-overview.svg)Network Overview Global Network Footprint](https://phoenixnap.com/network) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/03-network-locations.svg)Network Locations U.S., Europe, APAC, LATAM](https://phoenixnap.com/network/locations) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/04-speed-test.svg)Speed Test Download Speed Test](https://phoenixnap.com/network/speed-test) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/01-learn-mobile.svg)LEARN](https://phoenixnap.com/kb) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/02-blog.svg)Blog IT Tips and Tricks](https://phoenixnap.com/blog/) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/04-resource-library.svg)Resource Library Knowledge Resources](https://phoenixnap.com/company/resource-library) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/05-glossary.svg)Glossary IT Terms and Definitions](https://phoenixnap.com/glossary/) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/06-events.svg)Events Let's Meet\!](https://phoenixnap.com/company/it-events) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/07-newsroom.svg)Newsroom Media Library](https://phoenixnap.com/company/press) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/08-developers.svg)Developers Development Resources Portal](https://developers.phoenixnap.com/) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/09-apis.svg)APIs Access Our Public APIs](https://developers.phoenixnap.com/apis) - [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2025/11/10-github.svg)GitHub Public Code Repositories](https://github.com/phoenixnap) [Home](https://phoenixnap.com/) Ā» [KB](https://phoenixnap.com/kb/) Ā» [DevOps and Development](https://phoenixnap.com/kb/category/devops-and-development) Ā» How to Cherry-Pick from Another Branch in Git # How to Cherry-Pick from Another Branch in Git ![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E) ![](https://secure.gravatar.com/avatar/7ca3bb5c515df96f3d0e5c308042255b?s=200&d=mm&r=g) By [Bosko Marijan](https://phoenixnap.com/kb/author/boskom) Published: October 2, 2023 Topics: [git](https://phoenixnap.com/kb/tag/git) Cherry-picking in Git is a useful operation that allows users to select and apply a single commit from one branch to another. It is an alternative to [git rebase and git merge](https://phoenixnap.com/kb/git-rebase-vs-merge), which are used to apply multiple commits to another branch. **This tutorial will show how to cherry-pick a commit from another branch in Git.** ![How to cherry-pick from another branch in Git - a tutorial.](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20400'%3E%3C/svg%3E) ![How to cherry-pick from another branch in Git - a tutorial.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/how-to-cherry-pick-from-another-branch-in-git.png) Prerequisites - Git installed (follow our tutorials to [install Git on Ubuntu](https://phoenixnap.com/kb/how-to-install-git-on-ubuntu), [macOS](https://phoenixnap.com/kb/install-git-on-mac), [Windows](https://phoenixnap.com/kb/how-to-install-git-windows), [CentOS 7](https://phoenixnap.com/kb/how-to-install-git-on-centos-7), or [CentOS 8](https://phoenixnap.com/kb/how-to-install-git-centos-8)). - A [Git repository](https://phoenixnap.com/kb/what-is-a-git-repository). - A [separate branch](https://phoenixnap.com/kb/git-create-new-branch) with multiple [commits](https://phoenixnap.com/kb/how-git-works#ftoc-heading-3). ## What Is Cherry-Picking in Git? Cherry-picking in Git is a process of choosing and applying **specific commits** from one branch to another. Through cherry-picking, users can extract one or several commits from one branch's history and apply them as [new commits](https://phoenixnap.com/kb/how-to-use-git#ftoc-heading-8) on a different branch. The process helps incorporate specific changes, such as bug fixes or features, without merging the entire source branch. Picking individual commits facilitates management and integrates changes granularly within a Git repository. ## When to Use Git Cherry-Picking? Use cherry-picking in Git to select specific changes from one branch and apply them to another without merging the entire branch. It is a great option for selectively incorporating bug fixes, features, or other changes from one branch into another. While cherry-picking is a valuable tool for selective changes, consider the context of your project and its potential implications on commit history, collaboration, and code dependencies. If there are possible negative implications of cherry-picking, opt for alternative Git strategies like merging or rebasing. The situations when you need to avoid using Git cherry-pick are: - **When changes depend on a series of commits**. If the commit you want to pick depends on a series of commits in the source branch and cherry-picking them individually would break the intended functionality, merging or rebasing the entire branch is a better choice. Cherry-picking individual commits may result in the code not working as expected. - **When it disrupts branch integrity.** Cherry-picking can disrupt the chronological order of commits in a branch's history. Avoid cherry-picking if it is crucial to preserve the exact branch history. - **When it duplicates commits.** Cherry-picking can lead to duplicated commits if the same changes are cherry-picked into multiple branches. Doing so makes it hard to track changes and increases the risk of conflicts in the future. - **When it causes merge conflicts.** Cherry-picking can introduce complex [merge conflicts](https://phoenixnap.com/kb/how-to-resolve-merge-conflicts-in-git), especially when the same changes have occurred in the source and target branches. In that case, it is simpler to merge the branches instead. ## How to Use Git Cherry-Picking? To cherry-pick in Git, utilize the **`git log`** command to pinpoint the commit you want to cherry-pick. Then, cherry-pick the commit onto the target branch using the commit ID. Follow the steps below: 1\. Find the commit ID by running: ``` git log ``` ![Checking the Git log for commit ID.](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20344'%3E%3C/svg%3E) ![Checking the Git log for commit ID.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/see-the-git-log.png) For this tutorial, we will cherry-pick the commit **`71277daebbb157f7018a73e482e2379d9efceb64`** (new file) from the **`master`** branch. Take note of the commit ID you want to cherry-pick, as you will need it later. 2\. [Switch to the branch](https://phoenixnap.com/kb/git-switch-branch) you want to cherry-pick the commit to. The syntax is: ``` git switch [branch-name] ``` We will cherry-pick the commit to a branch named **`test-branch`**: ![Switching branches in Git.](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20130'%3E%3C/svg%3E) ![Switching branches in Git.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/switch-branch-in-git.png) 3\. After switching to the target branch, cherry-pick the commit using the commit ID you copied from the log. The syntax for cherry-picking is: ``` git cherry-pick [commit id] ``` We will run the following command to cherry-pick the commit mentioned earlier: ``` git cherry-pick 71277daebbb157f7018a73e482e2379d9efceb64 ``` ![Using cherry-pick on a commit in Git.](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20192'%3E%3C/svg%3E) ![Using cherry-pick on a commit in Git.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/cherry-picking-a-commit-in-git.png) The command cherry-picks the specified commit from the **`master`** branch to the **`test-branch`**, adding a new commit in the branch history, as shown in the output of **`git reflog`**: ![Checking the cherry-pick commit in git reflog.](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20274'%3E%3C/svg%3E) ![Checking the cherry-pick commit in git reflog.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/see-cherry-pick-in-branch-history.png) **Note:** See how to [undo the last commit](https://phoenixnap.com/kb/git-revert-last-commit) using **`git revert`**. Conclusion Git cherry-pick is a powerful and versatile tool that allows to selectively apply specific commits from one branch to another. However, make sure to use cherry-picking with caution and ensure that the changes you apply are appropriate in the context of the project to avoid conflicts and code inconsistencies. Next, see how to [check out a file from another branch](https://phoenixnap.com/kb/git-checkout-file-from-another-branch) or learn to [squash commits in Git](https://phoenixnap.com/kb/git-squash). Was this article helpful? YesNo Contents - [What Is Cherry-Picking in Git?](https://phoenixnap.com/kb/git-cherry-pick#What_Is_Cherry-Picking_in_Git) - [When to Use Git Cherry-Picking?](https://phoenixnap.com/kb/git-cherry-pick#When_to_Use_Git_Cherry-Picking) - [How to Use Git Cherry-Picking?](https://phoenixnap.com/kb/git-cherry-pick#How_to_Use_Git_Cherry-Picking) Subscribe to our newsletter [SUBSCRIBE](https://phoenixnap.com/developers-monthly-newsletter) Next you should read [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20400'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2023/08/how-to-overwrite-local-git-branch-with-remote.png)](https://phoenixnap.com/kb/git-overwrite-local-branch-with-remote) [DevOps and Development](https://phoenixnap.com/kb/category/devops-and-development) [SysAdmin](https://phoenixnap.com/kb/category/sysadmin) [How to Overwrite Local Branch with Remote in Git](https://phoenixnap.com/kb/git-overwrite-local-branch-with-remote) [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20400'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2023/08/how-to-compare-two-branches-in-git.png)](https://phoenixnap.com/kb/git-compare-two-branches) [DevOps and Development](https://phoenixnap.com/kb/category/devops-and-development) [SysAdmin](https://phoenixnap.com/kb/category/sysadmin) [How to Compare Two Git Branches](https://phoenixnap.com/kb/git-compare-two-branches) [![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20400'%3E%3C/svg%3E)![](https://phoenixnap.com/kb/wp-content/uploads/2023/07/how-to-change-git-commit-message.png)](https://phoenixnap.com/kb/git-change-commit-message) [DevOps and Development](https://phoenixnap.com/kb/category/devops-and-development) [SysAdmin](https://phoenixnap.com/kb/category/sysadmin) [How to Change Git Commit Message](https://phoenixnap.com/kb/git-change-commit-message) [![How To Use The Git Fetch Command](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20400'%3E%3C/svg%3E)![How To Use The Git Fetch Command](https://phoenixnap.com/kb/wp-content/uploads/2021/12/how-to-use-the-git-fetch-command.png)](https://phoenixnap.com/kb/git-fetch) [DevOps and Development](https://phoenixnap.com/kb/category/devops-and-development) [Git Fetch: Definition & Examples](https://phoenixnap.com/kb/git-fetch) CONTACT US [Get a Quote](https://phoenixnap.com/contact-us) [Support (1-855-330-1509)](tel:1-855-330-1509) [Sales (1-877-588-5918)](tel:1-877-588-5918) - [Colocation](https://phoenixnap.com/colocation) - [Phoenix](https://phoenixnap.com/colocation/phoenix) - [Ashburn](https://phoenixnap.com/colocation/ashburn) - [Amsterdam](https://phoenixnap.com/colocation/amsterdam) - [Atlanta](https://phoenixnap.com/colocation/atlanta) - [Belgrade](https://phoenixnap.com/colocation/belgrade) - [Singapore](https://phoenixnap.com/colocation/singapore) - [Shipping Instructions](https://phoenixnap.com/colocation/shipping-instructions) RECENT POSTS ["Invalid Reference Format" Error in Docker: How to Fix](https://phoenixnap.com/kb/docker-invalid-reference-format) [Python dict() Function Explained](https://phoenixnap.com/kb/python-dict) [Ansible get\_url Module: Download Files from URL](https://phoenixnap.com/kb/ansible-get-url) [Docker Desktop: Unexpected WSL Error](https://phoenixnap.com/kb/docker-desktop-unexpected-wsl-error) [How to Check if a File Exists in Python](https://phoenixnap.com/kb/check-if-file-exist-python) - [Servers](https://phoenixnap.com/servers/dedicated) - [Bare Metal Cloud](https://phoenixnap.com/bare-metal-cloud) - [Dedicated Servers](https://phoenixnap.com/servers/dedicated) - [Database Servers](https://phoenixnap.com/servers/database) - [Virtualization Servers](https://phoenixnap.com/servers/virtualization) - [High Performance Computing (HPC) Servers](https://phoenixnap.com/servers/high-performance-computing-hpc) - [Dedicated Streaming Servers](https://phoenixnap.com/servers/streaming) - [Dedicated Game Servers](https://phoenixnap.com/servers/dedicated-game-servers) - [Dedicated Storage Servers](https://phoenixnap.com/servers/storage) - [SQL Server Hosting](https://phoenixnap.com/servers/sql-server-hosting) - [Dedicated Servers in Amsterdam](https://phoenixnap.com/dedicated-servers-amsterdam-netherlands) - [Cloud Servers in Europe](https://phoenixnap.com/cloud-services/cloud-servers-europe) - [Big Memory Infrastructure](https://phoenixnap.com/bare-metal-cloud/big-memory-infrastructure) - [Buy Now](https://admin.phoenixnap.com/wap-pncpadmin-shell/orderForm?bmbPath=/order-form?currencyCode=usd) - [BMC portal](https://signup.bmc.phoenixnap.com/) CLOUD SERVICES - [Data Security Cloud](https://phoenixnap.com/security/data-security-cloud) - [Managed Private Cloud](https://phoenixnap.com/private) - [Object Storage](https://phoenixnap.com/object-storage) - [Solutions](https://phoenixnap.com/infrastructure-solutions) - [Disaster Recovery](https://phoenixnap.com/infrastructure-solutions/disaster-recovery-services) - [Web Hosting Reseller](https://phoenixnap.com/reseller-hosting) - [SaaS Hosting](https://phoenixnap.com/infrastructure-solutions/saas-hosting) COMPLIANCE - [HIPAA Ready Hosting](https://phoenixnap.com/compliance/hipaa-compliant-hosting) - [PCI Compliant Hosting](https://phoenixnap.com/compliance/pci-compliant-hosting) - [Privacy Center](https://phoenixnap.com/) - [Do not sell or share my personal information](https://phoenixnap.com/) NEEDS - [Disaster Recovery Solutions](https://phoenixnap.com/infrastructure-solutions/disaster-recovery-services) - [High Availability Solutions](https://phoenixnap.com/infrastructure-solutions/high-availability-solutions) - [Cloud Evaluation](https://phoenixnap.com/offers/cloud-evaluation-demo) INDUSTRIES - [Web Hosting Providers](https://phoenixnap.com/reseller-hosting) - [Legal](https://phoenixnap.com/infrastructure-solutions/legal-it) - [MSPs & VARs](https://phoenixnap.com/infrastructure-solutions/it-partners) - [Media Hosting](https://phoenixnap.com/infrastructure-solutions/media-hosting) - [Online Gaming](https://phoenixnap.com/infrastructure-solutions/online-gaming) - [SaaS Hosting Solutions](https://phoenixnap.com/infrastructure-solutions/saas-hosting) - [Ecommerce Hosting Solutions](https://phoenixnap.com/infrastructure-solutions/ecommerce-hosting) COMPANY - [About phoenixNAP](https://phoenixnap.com/about) - [IaaS Solutions](https://phoenixnap.com/company/iaas-provider) - [Customer Experience](https://phoenixnap.com/company/customer-experience) - [Platform](https://phoenixnap.com/cloud-services/platform) - [Schedule Virtual Tour](https://phoenixnap.com/phoenix-data-center-virtual-tour) - [Open Source Community](https://phoenixnap.com/company/open-source-community) - [Resource Library](https://phoenixnap.com/company/resource-library) - [Press](https://phoenixnap.com/company/press) - [Events](https://phoenixnap.com/company/it-events) - [Careers](https://techjobs.dev/jobs/) - [Promotions](https://phoenixnap.com/promotions) - [Contact Us](https://phoenixnap.com/contact-us) - [Legal](https://phoenixnap.com/cs/legal/) - [Privacy Policy](https://phoenixnap.com/infrastructure-solutions/legal-it/eu-u-s-data-privacy-framework-program-eu-u-s-dpf-compliant-privacy-policy) - [Terms of Use](https://phoenixnap.com/cs/legal/aup.html) - [DMCA](https://phoenixnap.com/cs/legal/dmca.html) - [GDPR](https://phoenixnap.com/gdpr) - [Sitemap](https://phoenixnap.com/sitemap) - [Blog](https://phoenixnap.com/blog) - [Resources](https://phoenixnap.com/company/resource-library) - [Knowledge Base](https://phoenixnap.com/kb) - [IT Glossary](https://phoenixnap.com/glossary) - [GitHub](https://github.com/phoenixnap) - [RFP Template](https://phoenixnap.com/company/it-resources/data-center-rfp-template) Ā© 2025 phoenixNAP \| Global IT Services. All Rights Reserved.
Readable Markdown
![](https://secure.gravatar.com/avatar/7ca3bb5c515df96f3d0e5c308042255b?s=200&d=mm&r=g) Topics: Cherry-picking in Git is a useful operation that allows users to select and apply a single commit from one branch to another. It is an alternative to [git rebase and git merge](https://phoenixnap.com/kb/git-rebase-vs-merge), which are used to apply multiple commits to another branch. **This tutorial will show how to cherry-pick a commit from another branch in Git.** ![How to cherry-pick from another branch in Git - a tutorial.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/how-to-cherry-pick-from-another-branch-in-git.png) Prerequisites Git installed (follow our tutorials to [install Git on Ubuntu](https://phoenixnap.com/kb/how-to-install-git-on-ubuntu), [macOS](https://phoenixnap.com/kb/install-git-on-mac), [Windows](https://phoenixnap.com/kb/how-to-install-git-windows), [CentOS 7](https://phoenixnap.com/kb/how-to-install-git-on-centos-7), or [CentOS 8](https://phoenixnap.com/kb/how-to-install-git-centos-8)). A [Git repository](https://phoenixnap.com/kb/what-is-a-git-repository). A [separate branch](https://phoenixnap.com/kb/git-create-new-branch) with multiple [commits](https://phoenixnap.com/kb/how-git-works#ftoc-heading-3). What Is Cherry-Picking in Git? Cherry-picking in Git is a process of choosing and applying **specific commits** from one branch to another. Through cherry-picking, users can extract one or several commits from one branch's history and apply them as [new commits](https://phoenixnap.com/kb/how-to-use-git#ftoc-heading-8) on a different branch. The process helps incorporate specific changes, such as bug fixes or features, without merging the entire source branch. Picking individual commits facilitates management and integrates changes granularly within a Git repository. When to Use Git Cherry-Picking? Use cherry-picking in Git to select specific changes from one branch and apply them to another without merging the entire branch. It is a great option for selectively incorporating bug fixes, features, or other changes from one branch into another. While cherry-picking is a valuable tool for selective changes, consider the context of your project and its potential implications on commit history, collaboration, and code dependencies. If there are possible negative implications of cherry-picking, opt for alternative Git strategies like merging or rebasing. The situations when you need to avoid using Git cherry-pick are: **When changes depend on a series of commits**. If the commit you want to pick depends on a series of commits in the source branch and cherry-picking them individually would break the intended functionality, merging or rebasing the entire branch is a better choice. Cherry-picking individual commits may result in the code not working as expected. **When it disrupts branch integrity.** Cherry-picking can disrupt the chronological order of commits in a branch's history. Avoid cherry-picking if it is crucial to preserve the exact branch history. **When it duplicates commits.** Cherry-picking can lead to duplicated commits if the same changes are cherry-picked into multiple branches. Doing so makes it hard to track changes and increases the risk of conflicts in the future. **When it causes merge conflicts.** Cherry-picking can introduce complex [merge conflicts](https://phoenixnap.com/kb/how-to-resolve-merge-conflicts-in-git), especially when the same changes have occurred in the source and target branches. In that case, it is simpler to merge the branches instead. How to Use Git Cherry-Picking? To cherry-pick in Git, utilize the **`git log`** command to pinpoint the commit you want to cherry-pick. Then, cherry-pick the commit onto the target branch using the commit ID. Follow the steps below: 1\. Find the commit ID by running: ![Checking the Git log for commit ID.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/see-the-git-log.png) For this tutorial, we will cherry-pick the commit **`71277daebbb157f7018a73e482e2379d9efceb64`** (new file) from the **`master`** branch. Take note of the commit ID you want to cherry-pick, as you will need it later. 2\. [Switch to the branch](https://phoenixnap.com/kb/git-switch-branch) you want to cherry-pick the commit to. The syntax is: We will cherry-pick the commit to a branch named **`test-branch`**: ![Switching branches in Git.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/switch-branch-in-git.png) 3\. After switching to the target branch, cherry-pick the commit using the commit ID you copied from the log. The syntax for cherry-picking is: We will run the following command to cherry-pick the commit mentioned earlier: ![Using cherry-pick on a commit in Git.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/cherry-picking-a-commit-in-git.png) The command cherry-picks the specified commit from the **`master`** branch to the **`test-branch`**, adding a new commit in the branch history, as shown in the output of **`git reflog`**: ![Checking the cherry-pick commit in git reflog.](https://phoenixnap.com/kb/wp-content/uploads/2023/10/see-cherry-pick-in-branch-history.png) Conclusion Git cherry-pick is a powerful and versatile tool that allows to selectively apply specific commits from one branch to another. However, make sure to use cherry-picking with caution and ensure that the changes you apply are appropriate in the context of the project to avoid conflicts and code inconsistencies. Next, see how to [check out a file from another branch](https://phoenixnap.com/kb/git-checkout-file-from-another-branch) or learn to [squash commits in Git](https://phoenixnap.com/kb/git-squash). Was this article helpful? YesNo
Shard39 (laksa)
Root Hash8557101678125738839
Unparsed URLcom,phoenixnap!/kb/git-cherry-pick s443