Using Bitbucket with a production server

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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

28,447 views 26 12
Join discussion

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