Deploy Craft CMS with Git

Learn how to deploy Craft CMS code base with Git to fortrabbit.

Get ready

For best results here, make sure you have completed all steps from the get ready guide, have Craft installed locally and setup. This guide is for advanced users, making use of Git and Composer, it can be applied to Professional and Universal Apps on fortrabbit. There is a more basic guide to install Craft using SFTP over here.

Deploy the Craft code base with Git

Trigger the following commands in your local terminal:

# 1. Initialize Git (when not already done)
$ git init .

# 2. Add your App's Git remote to your local repo
$ git remote add fortrabbit {{ssh-user}}@deploy.{{region}}.frbit.com:{{app-name}}.git

# 3. Download the fortrabbit Craft .gitignore file
$ curl -O  https://raw.githubusercontent.com/fortrabbit/craft-starter/master/.gitignore

# 4. Add changes to Git
$ git add -A

# 5. Commit changes
$ git commit -m 'Initial commit'

# 6. Initial push and upstream
$ git push -u fortrabbit master
# The first push takes a little longer
# as it runs Composer

# 7. From there on only
$ git push

Got an error? Please see the access troubleshooting and our Git guide.

Next steps

Please also make yourself familiar with the options to deploy the Craft assets folder separately. There are two dedicated guides here, depending on your App's Stack:

Last not least, see our Craft tuning guide to truly master Craft on fortrabbit.

Further readings

Craft CMS

Install guides

Develop & deploy

Teamwork

Platform

Stacks

Need individual help?
Learn about Company plans ›
Looking for an old article?
See the full list of articles ›
Found an error?
Contribute on GitHub ›