Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Using Bitbucket with a production server

TnCoders December 15, 2017

Basicaly I’m stack:

I’m developing A PHP website in Local and I was sending things via FTP to production server when it’s ok.

Now I switched to git .I created a private git repo in Bitbucket and I sanded everything from my local (master) to my remote repo on bitbucket.

Ok now everything is ok.

So what I want to do is.

1/ Working on my master local repo and when I’m satisfied with the result I push to my remote repo.

then

2/ I would like now to pull changes from bitbucket repo to my production server (linux) wich is now not a git repo and git is not yet installed on the server.

How can I do the part 2? I already know how to do the part 1.

But for part 2? How can I transform an existing project with no git repo to a git repo and pull changes from my bitbucket repo?

1 answer

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 18, 2017

Hi! The easiest way would be: 

  1. Install git in your production server, this is explained at Setting up a repository.
  2. Clone your repo from Bitbucket to your prod server, Git clone.
  3. Add any new files / changes to the repo in the production server.
  4. Push to Bitbucket so you have the same contents in both environments, the steps are at Push code to Bitbucket.

You can also check, Importing code from an existing project for more information.

Hope that helps!

Ana

TnCoders December 18, 2017

Hi Ana, Thank you for your reply,

2/ Clone your repo from Bitbucket to your prod server, Git clone.

But git clone is primarily used to point to an existing repo and make a clone or copy of that repo at in a new directory, In my case i have already a website  in production with many daily visitor, so  no way to downtime.

and the git clone is for empty project not for already project in production.I'm wrong?

3/Add any new files / changes to the repo in the production server.

I don't understand this point. adding new file in the production server ? using FTP ? how ? that's what i would like to know can you explain ? how can it be done using git?

 

4/ Push to Bitbucket so you have the same contents in both environments

Push to bitbucket from where? my local repo ? and if yes then it was my question how can i pull all changes pushed to bitbucket to my production server using git?

 

Thank's for your help be patient with me im new to this.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events