Deploy from two branches to one

There are three branches named ‘first’, ‘second’ and ‘third’. The “first” and “second” branches contain the .travis configuration files, which, after a change in the current branch, perform deployment in the “third” branch. If changes occur in the first branch, then after deploy in the third branch there are files from the first branch. After the change in the second branch, in the third branch there are files from the second branch, but the files added there from the first branch are deleted. And it is necessary that in the third branch there should be files from both the first and the second branch. How to do it?