Setup Sourcetree to push on self-hosted repo

Charlotte Vial December 4, 2015

Hello,

I know my question will sound stupid but I'm just getting started with git and I need your help.

I'm currently using Git with Bitbucket and Sourcetree and it's working perfectly.

Now I would like to be able to push my changes directly on the live website instead of pushing to our Bitbucket repo and then add the edited files 1 by 1 throught the FTP ...

I have the SSH credentials for my server and I tried a few stuffs but none are working. 

 

Could anyone help? That would be very nice smile

Thanks

1 answer

0 votes
Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 4, 2015

SSH to you web server, change into the correct directory, and clone your git repo there.  Now you can update the webserver at any time by doing a "git pull" in that directory.  This would be the easiest way.

If you prefer to update it by doing a "git push" from your workstation, you should be able to do that as well.  Add the webserver as a second remote by using "git remote add webserver <url>".  It will take a little more work to get the paths and ports all set up correctly this way, though.

Charlotte Vial December 5, 2015

Hello Tim,

Thanks for your help.

How can I do that using Sourcetree ? I tried to log to my server using the command and it works, I tried to clone my repo and it worked as well BUT it creates a folder all the time like http://www.mywebsite.com/myproject while I want it to be in the root. 

My goal is to have a working version on my computer where I will work on and then to push the changes on the repo on Bitbucket and on my server.

Thanks

Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 7, 2015

You can do "git clone <url> ." to clone into the current working directory without creating a subdirectory. In SourceTree, you can add a remote by going to Repository->Repository Settings

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events