0

I have a laravel app on Cloudway DigitalOcean, my app in /public_html , I want to update my app using git , so I have created folder private_html/git , where I pull my edited project from bitbucket, now I want to checkout it to my public_html/ , how do I do that ? Thank You

Moyed Ansari
  • 8,436
  • 2
  • 36
  • 57
Mikail
  • 455
  • 1
  • 6
  • 18

1 Answers1

0

You can either deploy the changes to public/html via git or manually copy the files across.

Manually copy option

Depending on full path, something like:

cp -a private_html/git/. public_html/

Note: -a is a recursive option that preserves file attributes

This won't remove any files that have been removed in private_html/git so you would have to do that manually, or remove everything before copying the files across.

Git pull option

First, make sure you have pushed all the changes made in private_html/git to your remote (bitbucket repo).

Set up the current copy in public_html/ as a git repo.

In public_html/

git init

Then add the bit bucket remote

git remote add origin git@bitbucket.org:user-name/repo-name

Note: Get the proper bitbucket remote from your bitbucket account

Then pull the changes from the remote

git fetch --all

git reset --hard origin/master

Warning: You'll lose any differences that are currently in public/html so be careful. Always a good idea to back up everything before these kinds of changes so I'd suggesting archiving the code in public_html before overwriting it.

Scott Anderson
  • 1,363
  • 1
  • 10
  • 19