S
S
Sergey Burduzha2019-09-26 09:37:23
git
Sergey Burduzha, 2019-09-26 09:37:23

How to link git to files on the server?

Good afternoon.
I am developing a website on wordpress.
In git, I work only with files with a theme.
I use phpstorm as an editor.
And at work I created a project, added theme files to git and work with the project.
Configured via ctrl + s upload to hosting.
But the problem starts when I get home.
I go to the hosting, download the theme files locally and then, when I change something and try to upload it to the hosting, a large number of files are deleted from me, something is created and some bugs appear on the site.
Or am I doing something wrong?
I think that you don't need to download files from the server, but from the repository.
What do you think?
Thanks in advance for your reply.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
VicTHOR, 2019-09-26
@serii81

1) You need a remote repository.
2) On the hosting, the main developer logs in to the git (downloads it), close the hosting for everyone.
3) We pick up current user files on the hosting Git and pull them to the master branch remotely
4) All other developers (for example, you are at work and you are at home), tend to themselves the last commit, work and shoot (in a separate branch, if not one)
5 ) The master branch accepts the changes, makes a checkout on the hosting and voila - the actual files on the hosting, which were developed in different places.

P
postgresdev, 2019-09-26
@postgresdev

Through the repository

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question