Sure, being in master branch all you need to do is:

git merge <commit-id>

where commit-id is hash of the last commit from newbranch that you want to get in your master branch.

You can find out more about any git command by doing git help <command>. It that case it's git help merge. And docs are saying that the last argument for merge command is <commit>..., so you can pass reference to any commit or even multiple commits. Though, I never did the latter myself.

Answer from KL-7 on Stack Overflow
Discussions

How to merge a specific commit in Git - Stack Overflow
If you're trying to do this in ...uest-from-github ... This was asked 15 years ago. Is there a more modern answer? I understand cherry-picking "works," but as some answers detail, this has some risks if you merge later. ... Apply the change introduced by an existing commit. Do not forget to read bdonlan's answer about the consequence of cherry-picking in this post: "Pull all commits from a branch, push specified commits to another", where: ... Where C' has a different SHA-1 ID... More on stackoverflow.com
🌐 stackoverflow.com
May 19, 2009
How to merge branch till specific commit id via REST API - Bitbucket Server - The Atlassian Developer Community
for merging two branches via the REST API I follow this advice: and do it in 2 steps - create pool request like this: and then merge this PR via REST API. it works ok. but it merges branch1 from the last commit. now I need merge branch1 to branch2 only till specific commit id from branch1. ... More on community.developer.atlassian.com
🌐 community.developer.atlassian.com
0
April 22, 2021
question about Commit Id's
Maybe someone accidentally reset the second branch to the head of the first branch and force-pushed? 9 times out of 10 when I have to sort this kind of stuff out, one of my devs force pushed to their branch thinking nobody would notice… More on reddit.com
🌐 r/git
7
0
January 24, 2022
How to merge branches to a specific commit
git switch main; git merge 1.0.1 —ff-only; More on reddit.com
🌐 r/git
5
6
January 14, 2021
🌐
Linux Hint
linuxhint.com › merge-specific-commit-git
How to Merge a Specific Commit in Git – Linux Hint
To merge the specific Git commit, first, visit the Git repository. Note the commit id you need to merge. After that, switch to the branch in which you are merging the specific commit of another branch. Next, merge the commit using the “$ git cherry-pick <commit-id>” command.
🌐
Better Programming
betterprogramming.pub › git-cherry-pick-selecting-specific-commits-to-merge-f1bf245e052a
Git Cherry Pick - Select specific commits to merge | by Carlos Fernando Arboleda Garcés | Better Programming
December 13, 2023 - The next step is to check out the target branch. Then copy the needed IDs and execute the cherry-pick command. In this case, I will copy the commit IDs related to files 1, 2, 3, 5, and 6, omitting files 4, 4.1, and 4.2 since those belong to ...
🌐
DEV Community
dev.to › iamafro › how-to-merge-a-specific-commit-into-another-branch--oak
How to merge a specific commit into another branch - DEV Community
February 15, 2018 - First you checkout the branch you want to merge the commits into ... What this does is, "It applies the change introduced by the commit at the tip of the working branch and creates a new commit with this change". The issue I had with that was, I had made a couple of commits and I needed all those commits in the master branch. That's when I found it. What did I find? you may be asking. Gitlens is what I found.
🌐
Delft Stack
delftstack.com › home › howto › git › git merge specific commit
How to Merge a Specific Commit in Git | Delft Stack
March 11, 2025 - Learn how to merge a specific commit in Git using commands like cherry-pick and rebase. This article provides step-by-step instructions and examples to help you incorporate changes efficiently without merging entire branches. Perfect for developers looking to streamline their workflow and manage ...
🌐
Git
git-scm.com › docs › git-merge
Git - git-merge Documentation
GPG-sign the resulting merge commit. The <key-id> argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space. --no-gpg-sign is useful to countermand both commit.gpgSign configuration variable, and earlier --gpg-sign. ... In addition to branch names, populate the log message with one-line descriptions from at most <n> actual commits that are being merged.
Find elsewhere
🌐
Better Stack
betterstack.com › community › questions › how-to-merge-specific-commit
How to Merge a Specific Commit in Git | Better Stack Community
August 12, 2024 - Merging a specific commit from one branch into another in Git involves a few steps. This process typically requires using the cherry-pick command, which applies the changes from a specific commit onto your current branch. Here's a detailed guide on how to achieve this: First, identify the commit hash that you want to merge.
🌐
W3docs
w3docs.com › git
How to Merge a Specific Commit in Git | W3Docs
Sometimes it is necessary to merge a specific commit in Git. The below-given snippet is aimed at showing you how to do it in a rather fast and easy way.
🌐
Atlassian Developer Community
community.developer.atlassian.com › bitbucket development › bitbucket server
How to merge branch till specific commit id via REST API - Bitbucket Server - The Atlassian Developer Community
April 22, 2021 - for merging two branches via the ... to branch2 only till specific commit id from branch1. in git I can do like: git fetch --all git merge git push and after this branch2 has been merged only with commits till commit_id from ...
🌐
Reddit
reddit.com › r/git › question about commit id's
r/git on Reddit: question about Commit Id's
January 24, 2022 -

A development team has two separate Merge Requests and when one was merged into the master branch the development team claimed that a second unrelated merge request also got merged at the exact same time. At first I assumed that this was a problem between the keyboard and chair, but after investigating a bit, I noticed that both Merge Requests (different branches) somehow had the same Commit ID. I'm like 99.99% sure that shouldn't happen (as in two branches/merge requests having the same commit id), and that should explain why they merged together, but I want to make sure I'm understanding the problem correctly. Can anyone confirm for me?

🌐
Reddit
reddit.com › r/git › how to merge branches to a specific commit
r/git on Reddit: How to merge branches to a specific commit
January 14, 2021 -

I have two branches, main and develop. Lets say that this is my current commit history:

A - B - C - D (main) (tag 1.0.0) - E - F - G (tag 1.0.1) - H (develop)

I want to bring main to G (tag 1.0.1) so that it is one commit behind develop. Note that, I want all commits between main and G to also be included. Would I use cherry-pick or is there a better way?

🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-merge-commits-in-git
How to Merge Commits in Git? - GeeksforGeeks
July 23, 2025 - ... This method allows you to merge all changes from a branch but combine them into a single commit. ... git checkout main git merge --squash feature git commit -m "Merged feature branch as a single commit"
🌐
30 Seconds of Code
30secondsofcode.org › home › git › commit › merge commit for a commit
How can I find the merge commit given a Git commit? - 30 seconds of code
May 4, 2024 - # Syntax: git find-merge <commit> git find-merge 3050fc0 # c2ec1385b47a4b9024bdde77c0978a34359480ac · Using git rev-list, the command lists all the commits between the given commit and the branch, first following the full ancestry path and then following only the first parent.
🌐
W3Guy
w3guy.com › git-merge-commit-from-another-branch
Git: Merge a Specific Commit From One Branch to Another
May 28, 2016 - Scenarios like this is where git cherry-pick comes in handy. A cherry-pick is like a rebase for a single commit. It takes the patch that was introduced in a commit and tries to reapply it on the branch you’re currently on. This is useful if you have a number of commits on a topic branch and you want to integrate only one of them, or if you only have one commit on a topic branch and you’d prefer to cherry-pick it rather than run rebase. To merge a commit in branch B with SHA-1 checksum of 0afc917e754e03 to branch A;