Using Bitbucket with a production server

TnCoders I'm New Here Dec 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 vote

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 I'm New Here Dec 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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

705 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot