2
I wanted to know if it is possible a way to leave all my projects online so that I don’t keep modifying my code to upload it to the server.
Go some questions:
I use git, wanted to use a branch for each development environment, in this case it would be the best alternative?
Now with every update in the code I wanted to upload it straight to the server with push (GIT), without having to do manual uploads to the server. Like github, but it doesn’t interpret PHP code, just front-end, this is why I want to go straight to the server.
I don’t know if this is the best place to post this, but I hope so, thank you!
Updating
I found a blog where the guy teaches, Link
I’ll leave it open for anyone who wants to put their answer, but this question is duplicated, I don’t know if I should delete it?!
@egomesbrandao is talking about this?
My solution
My server plan is free, but it supports SSH, but in my plan (free) it is disabled. So I went to this link "Github git-ftp" and did according to the documentation.
Since my plan does not accept SSH I did by FTP even, but now I do not need to put FTP user and password whenever I update, just do this(user and password) once and give a "git push". This little program is slow, but automating the tasks already saves a nice time!
Thanks for the answers!
What is your workflow like until it comes into production? To suggest something more suitable.
– Marlysson
You mean using git similar to FTP?
– Woss
Yeah, git similar to FTP @Andersoncarloswoss
– Alex
You want to deploy your application using git?
– Jonathan Freitas
That’s like deploy, sorry I can’t explain, I’m not very advanced in git. @devsimoes
– Alex
Yes, it is possible to do this, and in my humble opinion is much better than using ftp, but you will need to configure the ssh connection on your server, many hosting servers already offer this option and even already come as the ready deploy option, as is the case with umbler.com, finally, another user has already asked a question similar to yours, take a look: http://answall.com/questions/82475/deploy-autom%C3%A1tico-ap%C3%B3s-git-push
– Jonathan Freitas
Would you recommend this? https://medium.com/@wesleysaraujo/deploy-com-git-configurando-e-executando-um-deploy-automatizado-156e3e1bc374#. 3easdunw2 @Jonathanfreitas
– Alex
Yes, he’s very detailed.
– Jonathan Freitas
Ah, when it comes to creating the *.git folder by using the mkdir app.git && cd app.git command, for security reasons, ideally do this outside the public folder or www, in a directory where the user cannot access it.
– Jonathan Freitas
Got it, thanks! @Jonathanfreitas
– Alex
@Jonathanfreitas has how to do this without using SSH ?
– Alex
What you want to do is: After each commit is in the repository, automatically publish the new version on a given server and for each server you want to use a brench, that’s it?
– Intruso
@Intruder I’ll give you an example. For development environment. use the master branch, and for the production "host". Or it could be the master for both of us, what I want is to end this by manually uploading to my server. I want a push or even a commit to deploy, my hosting plan does not allow me access to ssh ;/
– Alex
Yes, in addition to SSH, you can use the FTP protocol with GIT, with the git ftp push command, but for that, you need to use git-ftp on your local machine. http://git-ftp.github.io/git-ftp/
– Jonathan Freitas