Use Sourcetree (or other GUI) to pull commit on remote server

Hello,

At first, I’m sorry if I don’t use the good technical words. I’m not expert. I’ll try to be as clear as possible.

I use Sourcetree to create and push my commits from my local computer, which is my dev environment.

I have 2 other environments for my project, a staging and a production.

So far, the only thing I have figured to synchronize all my 3 environments is to push on my dev. Then connect by ssh on terminal (I’m on mac) to my staging server and pull, and repeat the same thing for my production.

It’s kind of a long and boring workflow, with many passwords to enter and commands to type.

My question is, is there a way I can setup from Sourcetree my remote servers (staging and production) to pull commits directly from the app ?

Or is there a quicker way to synchronize all my environments ?

Thanks for your help.

Would it be possible for you to correctly set up SSH keys on your staging and production environments? This way you’ll be able to safely update the codebase. Assuming SSH keys on all environments are set up properly, this could be your workflow:

  • Push from dev to GH
  • SSH into staging >  cd to the directory > type  git pull
  • Repeat the previous step on production

That’s already what I do.

But it requires a lot of commands after pushing :

  1. SSH to connect to the environment
  2. Enter password
  3. cd to directory
  4. git pull
  5. enter password
  6. exit
  7. Do 1-6 steps once again for each environment.

Nothing is quicker than that ?

Well, you could do one of the following things to trigger an automatic pull on staging/production:

Depending on the technologies used, you might have more options. Could you elaborate on those? What OS do you use, and in which language is your application written?

1 Like

Thanks Mark, i’ll take a look at your solutions.

I’m on Mac OS, but some of our dev team are on Windows. The git project is a website.