Reputation: 2122
I am new to Git. I have a Laravel PHP application in two servers.
Once I finish working with the local application repository, I push the changes into the remote repository.
After that, I use DeployHQ to deploy my changes into the test server.
If everything is ok with the test server, I will deploy it again into the live production server after few days.
When I do this, I need to keep change the server specific constants such as database credentials all the time from server to server.
Can I know is this the correct way to maintain Test and Production environments of a web application with Git?
Could you please share your thoughts on how you maintain/deploy test and production versions of your web app?
Thanks in advance!
Upvotes: 1
Views: 463
Reputation: 522539
Can I know is this the correct way to maintain Test and Production environments of a web application with Git?
What you described sounds like a typical development workflow which Git can readily handle.
When I do this, I need to keep change the server specific constants such as database credentials all the time from server to server.
Git has the ability to either track or not track any file in your project. So if you have server specific files, you can choose to not add them to your Git repository. Each server would maintain its own configuration while the PHP source code would be part of the repository.
Upvotes: 1