Moving a folder to its own git repo

Today I wanted to move a folder in a git repo to its own repo, but keep all history. I luckliy found a handy stackoverflow guide to help me =)

Create a submodule repository from a folder