Table of Contents
Other developers (identified by email address) can be invited to collaborate on your app:
$ heroku sharing:add firstname.lastname@example.org Adding email@example.com to myapp collaborators... done
When you invite a collaborator, they’ll be sent an email to let them know they were granted access to the app. If no existing Heroku account matches the email specified, an invitation email is sent.
All actions are supported for collaborators as they are for app owners except for the following, which are only support for app owners:
- Adding or removing paid add-ons
- Deleting or renaming the app
- Viewing invoices
These are the only actions that are restricted. Outside of those actions, collaborators can perform any other action that an owner can, including scaling applications.
Accessing an app as a collaborator
When someone grants you access to an app, you will receive an email with the app name and some other information to help you get started:
$ heroku info --app theirapp === theirapp Web URL: http://theirapp.herokuapp.com/ Git Repo: firstname.lastname@example.org:theirapp.git Repo Size: 960k Slug Size: 512k Owner Email: email@example.com Collaborators: firstname.lastname@example.org email@example.com
Next you should clone the app locally. You can use
heroku git:clone --app theirapp for this, but it’s recommended that you get access to their canonical repository (for instance on GitHub) and then use
heroku git:remote to add a git remote to your checkout.
At this point you can use
git push heroku to deploy local commits. Be sure your changes get pushed to the canonical repository (typically with
git push origin master) as well as the Heroku remote to avoid getting out of sync with your collaborators.
heroku sharing command to see the list of current collaborators:
$ heroku sharing === theirapp Collaborators firstname.lastname@example.org email@example.com
You can revoke a collaborator’s access using the
heroku sharing:remove command:
$ heroku sharing:remove firstname.lastname@example.org Removing email@example.com from myapp collaborators... done
Once access has been revoked, the user is no longer able to deploy changes or modify the app’s configuration.
Merging code changes
Once you’re collaborating with other developers, you may find that you’re prevented from pushing to the repo with a message like this:
$ git push heroku error: remote 'refs/heads/master' is not a strict subset of local ref 'refs/heads/master'. maybe you are not up-to-date and need to pull first?
This means that other developers have pushed up changes that you need to pull down and merge with your local repository. The easiest way to do this is to run
git pull --rebase. Ensure your changes don’t conflict with what you pulled down before deploying.