Search code examples
gitsourcetree

How to setup Sourcetree to deploy to Heroku and Bitbucket?


I have setup a repository that points to heroku. In the "Optional Extended Integration" I have chosen "Bitbucket Server" as the host type, Host URL is set to "https://bitbucket.org" and the username is set to my username. Now whenever I commit a change to heroku I would like to commit that to Bitbucket as well. Unfortunately this does not seem to work with the setup I mentioned above. Is there anything I am doing wrong here? I am using SourceTree for Mac.


Solution

  • If you need to get two remotes in sync, the most common way to achieve that is to push your changes to both:

    git commit -m <msg>
    git push origin <branch>
    git push bitbucket <branch>
    

    On SourceTree:

    • Click on "Push"

      enter image description here

    • Select the remote on the dropdown, then select which branch you want to push, and click on OK.

      enter image description here

    • Repeat the process to the other remote.

    Anternatives are: