Gluing branes — I