Skip to content

Commit

Permalink
Merge pull request #202 from arshadkazmi42/git-cherry-pick
Browse files Browse the repository at this point in the history
Add git commit cherry pick command
  • Loading branch information
arshadkazmi42 authored Jun 20, 2022
2 parents e666397 + 6874691 commit 2a9c813
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Give us a :star: if you like our work :heart:
## GIT

- [Clone repository](commands/git/git-clone-repo.md) - Clone a repository to any location.
- [Cherry Pick Commit](commands/git/git-cherry-pick-commit.md) - Copy one commit from one branch to another
- [Commit changes](commands/git/git-commit.md) - Commit the local changes.
- [Configure Author](commands/git/git-name-email-config.md) - Configure author name and email.
- [Configured Author](commands/git/git-name-email-config-check.md) - Check configured author name or email.
Expand Down
18 changes: 18 additions & 0 deletions commands/git/git-cherry-pick-commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Cherry Pick a Commit

Copy a commit from one branch to another. Run the below command on the destination branch where you want your commit to be copied

`git cherry pick -x {{COMMIT_SHA}}`

- <b>COMMIT_SHA: </b> Commit ID of the commit, which needs to be copied

#### Example:

`git commit -x ef579afe0a4540dfced0576930cbf88568cb8a12`

This will copy the commit from source branch and add it in current branch

### Related

- [Commit Amend](git-commit-amend.md)
- [Commit](git-commit.md)

0 comments on commit 2a9c813

Please sign in to comment.