Mantain several branches with same code for Symfony2

Mantain several branches with same code for Symfony2

I want to mantain 2.1, 2.2 and 2.3 branches for in my Symfony2 bundle.
Which is the best way of doing it, when I am currently developing the
master branch with changes I have to apply to all branches?