Push subdirectory to another branch with CI

I have the following setup:

branches:

  • develop
  • release
  • master

On the develop branch I have the following structure:

root

  • actual project dir
    – .gitignore
    – Readme.md
    – …
  • puphpet
  • .gitlab-ci.yml
  • Readme.md

When pushing to develop I want only the “actual project dir” to be pushed to the release branch.

Is that something that’s inbuilt somewhere? Or even reasonable to do? Should I maybe change something about the structure of both branches and project?