Answer the question
In order to leave comments, you need to log in
Website editing + git. How to arrange the work correctly?
I started using GIT a couple of weeks ago, the goal is a version control system.
I did it according to this instruction https://github.com/evenness/git-and-timeweb
The problem is that I'm used to editing project files in Sublime Text and changing them on the server immediately via SFTP , when I see that I did everything right, I do add + commit locally , I send it to the server, but because files were corrected directly on the server, there is a conflict.
If you edit files only locally and send changes only via add + commit , then there is no conflict .
To make it work like this, you need to raise a local web server, and this is not convenient.
Tell me, how do you work with projects?
It is important for me that it would be possible to edit files on the server directly, and at the same time be able to commit changes locally.
Only one person works with the site at a time.
Answer the question
In order to leave comments, you need to log in
Solved my problem like this:
Tell me, how do you work with projects?
edit project files in Sublime Text and immediately change them on the server via SFTP
Locally they are usually tested in a container, a stable version is deployed to the server. You can, again, a container.
You can automate the delivery of code to the server, for example, using the free gitlab repository and gitlab ci.
Github also offers several free ways to test, build, and deploy small projects.
Nothing is correct on the server. An exception could be some hot-hot-hot fix, although I'm not sure how correct this is - then you can do a git stash (after it was fixed in the repo). In other cases, you use a local server, and you test absolutely everything on the local.
Create a local server environment in Vagrant or Docker and test there. When a new developer appears, he will only need to start your container and will immediately be able to work locally.
To deploy to the server, you can use different softwares designed for this, there are a huge number of them: Jenkins, Travis, TeamCity, TFS, etc. You can, of course, cram every minute git pull into cron :) But it’s better to take, for example, Jenkins. Bitbucket, github and gitlab also provide this for this purpose with instructions on how to set it up.
PS: At this stage, take vagrant and a ready-made image for your tasks - it is easier to understand and configure with it, then you can already look towards the docker.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question