Case 1: First, switch to your master branch
$ git checkout master
Step 2: Then, to take all the commits from the bugfix branch and merges it with the current branch
$ git merge --squash bugfix
Step 3: Now, to create a single commit from the merged changes
$ git commit
For better understanding of git life-cycle please refer: