> For the complete documentation index, see [llms.txt](https://dojo.lkmx.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dojo.lkmx.io/ingles/git/use-git-cherry-pick.md).

# Use git cherry pick

To demonstrate how to use `git cherry-pick` let us assume we have a repository with the following branch state:

```git
    a - b - c - d   Main
         \
           e - f - g Feature
```

`git cherry-pick` usage is straight forward and can be executed like:

```git
git cherry-pick commitSha
```

In this example `commit`Sha is a commit reference. You can find a commit reference by using `git log`. In this example we have constructed lets say we wanted to use commit \`f\` in `main`. First we ensure that we are working on the `main` branch.

```git
git checkout main
```

Then we execute the cherry-pick with the following command:

```
git cherry-pick f
```

Once executed our Git history will look like:

```
    a - b - c - d - f   Main
         \
           e - f - g Feature
```

The f commit has been successfully picked into the main branch.

## Reference Links

* <https://www.atlassian.com/git/tutorials/cherry-pick>
