What you need is to squash commits.
You want to take a look to this article to have more information
Imagine that you have 3 commits that you want to convert into 1, because all of them should be really one single commit, so you want to have the new feature commit, and a license commit. They appear in reverse order (the first commit is the oldest)
You start by rebasing your current branch
$ git rebase -i HEAD~4
pick 9420b31 New feature
pick 8414d83 Adding license to code
pick 7bfb349 More info into the license
pick c79e70f Fixing license
# Rebase 93275f0..9420b31 onto 93275f0
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
And then change the license commits from "pick" to "fixup" (if you want to discard the commit message) or "squash" (if you need to keep it).
In this example, that would become
$ git rebase -i HEAD~4
pick 9420b31 New feature
pick 8414d83 Adding license to code
fixup 7bfb349 More info into the license
fixup c79e70f Fixing license
# Rebase 93275f0..9420b31 onto 93275f0
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
After that, you'll have only two commits: one adding the feature, and one adding the license (however, the hash representing the license commit will change).
Just one note: if you have already pushed the history into a remote server, you may need to "push --force" them. And if someone has cloned that repo, they may have problems (conflicts) when updating.