B
B
Bogdan Fil2015-01-09 15:21:12
git
Bogdan Fil, 2015-01-09 15:21:12

How to start using Git in a created PhpStorm project?

Now everything works for me in this form:
1) PhpStrom is installed on the local machine under Windows 7.
2) Apache HTTP server is up on the server. The site itself was raised there.
3) I edit the file on the local machine and automatically upload them to the server immediately.
I want to set up VCS, actually Git. Already installed Git on the server and on the local machine.
But now the question remains. What should I do when I save edits in files. They are also uploaded to the server. And I get a lot of corrected files on the server that are not in the commit.
I'm interested in how to make a commit on the server from PhpStorm? Or make edits, also save them to the server itself, and when you are ready to make a commit, then do it on the local machine, and therefore push to the server? What is the right way to do it? Maybe there is a good article?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg Prilepa, 2015-01-12
@OAPrilepa

The simplest option is this:
1. There are local project files. If deployment (ftp) is configured, then files are uploaded to the web server with the project when editing.
2. There is a repository next to local files, commits are made to it.
More complicated, you can use the server to store repositories (actually copies of the local repository, remote). For example, as mentioned above, bitbucket. Or github or gitlab. In this model, the server still doesn't know that it has git.
And the most advanced option, when git is also installed on the combat web server, and the local web server is raised. Work is underway on the local, commits are taking place. And when a push (or pull-request and further merge) is made to a server with git repositories (bitbucket), a pre-configured event handler can automatically work there - hook, which pulls a certain script on the combat web server, which in turn does git pull originmaster.
In general, if you work with the project alone, and you need version control for yourself, the very first option will do.
If you want to back up the repository somewhere outside the machine (or work is done sporadically on different machines), then you can connect bitbucket and do push\pull\fetch with it.
And if team development is supposed, but there is no technical possibility to raise a local copy of the project, then the second option is suitable (we often work according to this scheme).
And the third option is the most difficult, we usually use it for technical support, when there is "our" copy of the site and a "combat" one. Those. nothing gets on the combat copy without full testing on ours.

A
Alexey Yakhnenko, 2015-01-09
@ayahnenko

it's probably better to code locally, commit and then push to the server.
do not develop directly on the server.

K
Konstantin Chukhlomin, 2015-01-09
@undefine

In general, of course, ideally, the server should not know anything about the version control system. It should receive some ready-made “package” (rpm/zip/tar) from Jenkins, for example, which takes it from a remote repository, for example, on BitBucket/GitHub.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question