Last Updated:
Deploy Subfolder
Deploy Subfolder Tejas Sawant

How to deploy git sub folder to heroku ?

Tejas Sawant
Tejas Sawant heroku

This article shows how you deploy sub folder/sub directory to heroku.

First you need to create project on heroku.

Heroku project

After that you need to have heroku cli and git installed. Then navigate to your folder from where you have to deploy your project.


I this tutorial have to deploy server folder on to the heroku. So open parent folder into cmd/terminal.

Parent folder

After that login to your heroku cli and then select your project from heroku by typing command. heroku git:remote -a your-project-name

Selecting project

After that git subtree push --prefix your-subfolder heroku master enter this command in your parent directory. In this case i have to deploy server folder to heroku. After that you can see your project has started deploying

Deploying Started

I you output as following your project has successfully deployed.

Deploy Successfull