Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Alzaabi98's avatar

How can to make testing environment using forge and digital ocean?

Hi all,

How can i make replica of my site which is now hosted using forge/digital ocean and I am using git to update my changes.. I want to make copy of the site as testing enviroment. how can i do that..

also how can i manage changes between the two enviroments.. waiting your ideas..

Abdulaziz

0 likes
5 replies
richard@gorbutt.com's avatar

I created a dev.mydomain.com site in Forge, and that is tied to a dev branch in git. I simply push to that branch, it makes it to the dev site, When I'm tested I merge the repo into my master and into production...

1 like
willvincent's avatar

@Gorby's approach is pretty standard practice in my experience. I'd also suggest making use of something like travis or jenkins to do automated tests for you. In fact, with one of those you could probably skip forge altogether and let them do the deploy if tests pass.

Alzaabi98's avatar

Gorby, I liked this idea but if I did that.

. can I delete the branch without implementing it.. I am still new to git..

Gorby,, what about the database and migrations.. do you make another database .. or pointing to the same one..???

what about of you have keys for social login .. or other apis.. do you create sperate one for that??

richard@gorbutt.com's avatar
Level 2

@Alzaabi98 You can create and delete branches at will in Git, they way I work (and probably not the best but it works for me), I have two main branches, master & dev. I tend to work in dev, but sometimes if I'm experimenting I spin off another branch (call it want you want), fiddle. If I like I merge back into dev. Then merge dev into master when I'm good to release.

I keep databases separate and have a different social api key so I can track it. .env makes that easy.

When I get ready to make money from the site, I'll probably split into three branches.

MASTER (Production)

STAGING (Test Site/Beta etc.)

DEV (What I'm coding now/server test, private)

Many ways to skin the cat!

1 like

Please or to participate in this conversation.