Skip to content

How to Merge a Specific Git Commit

TIP

Example: develop contains a commit that needs to be merged into main.

  1. Run git log on the source branch to find the commit ID you want to merge.

    file

  2. Check out the target branch, e.g. git checkout main.

    file

  3. Use git cherry-pick <commit_id> to apply the commit, then push as needed.

    file

Released under the MIT License.