You have two options, a merge, or a rebase.
Merge
Merging branch1 into master is the simplest operation to understand, and the option I would recommend. However, it will appear as a new commit on the master, with a different commit id.
We will take the new commits from branch1 and attempt to merge them into master as a new changeset which we can then commit. This will preserve the history of both branch1 and master.
From the command line, you would execute the following steps:
1) First checkout the branch you wish to merge into
git checkout master
2) Now merge in your branch, using the --no-ff option
git merge --no-ff branch1
3) You can now delete the old branch if desired
git branch -d branch1
Rebase
The alternative approach is to perform a rebase.
By rebasing your branch 1 onto master, you will effectively replay the commit history of branch1 onto the master. Afterwards, it will appear as though you had originally checked commit 'b' into master, preserving your commit id.
Again, from the command line, you would execute the following steps:
1) First checkout the branch you want to rebase into
git checkout master
2) Now rebase your branch into the master
git rebase branch1
Note - there are some caveats with rebasing, and if you don't fully understand how it works, it's safer to use a merge instead.
If in doubt - merge, don't rebase.