N
N
Nikita Sklyuev2011-11-29 02:00:38
git
Nikita Sklyuev, 2011-11-29 02:00:38

Git and Ftp..........?

Hello!
I have the following question.
Until today, I did not have to work with version control systems, but today there was a need for this system when working on 1 project.
The problem consists in the following, I work on the project 1 but by several machines. It's not very convenient to deploy a project on each machine, and then think about which machine the last changes were made to. I decided to try to work with GIT for version control, but the problem is that when changes are made to the project, it must be immediately updated on the working hosting.
Is there any way to organize the export from GitHub to FTP? If not, does anyone know of an alternative to this method? We need a collective approach to the development of the site, with an instant update on the hosting!

Thanks in advance for your reply!

Answer the question

In order to leave comments, you need to log in

9 answer(s)
B
Barmunk, 2013-04-26
@Barmunk

Well, how? Did you succeed? I’m also thinking of implementing it this way, otherwise I won’t understand the meaning of such storages, I don’t need another backup ...

A
Alexander Tomsk, 2015-12-07
@GreenRobot

To date, there is such a solution - https://github.com/git-ftp/git-ftp/
It is very simple to use:

$ cd my_git_tracked_project
$ git ftp push --user <user> --passwd <password> ftp://host.example.com/public_html

It's even easier to use the Git for Brackets extension in the Brackets open text editor , after installation you need to go to the settings and enable the [x] Use Git-ftp option. There is beauty in general - you need to update the code in the repository - 1 key combination and one more to upload the site to hosting via FTP.

K
kreativf, 2011-11-29
@kreativf

Usually this is done not via FTP, but via git push to the server (yes, this is not very good in terms of security). If you only have FTP, maybe this will do?

M
Mikhail Osher, 2011-11-29
@miraage

If I were you, I would use SVN rather than GIT for this task. Make a commit on the server "svn up ." from the working directory - voila, you're done! (:

B
bagyr, 2011-11-29
@bagyr

You can read about hooks: book.git-scm.com/5_git_hooks.html , although there doesn't seem to be anything you need.
The simplest solution is git push && custom-script-to-update-ftp.

A
Alexander Grebenshchikov, 2011-11-29
@archerz

I don't know about git, but you can do it with mercurial. You need to install the mercurial server and add a hook to the repository on the server, so when pushing commits to the server, this hook will be called, which will update the working copy on the server from the same repository.
At my work, a backup of the repository to bitbucket is implemented in this way. After someone pushes to the server, these changes are pushed further by the hook to the bitbucket.

I
Infernal, 2011-11-29
@Infernal

here is the solution for github:
writing.markchristian.org/how-to-deploy-your-code-from-github-automatic
automatically does a pull on the server every time you do a push

N
Nikita Sklyuev, 2011-11-30
@trilodi

Thanks everyone, I'll try!

R
Rivermc, 2017-11-16
@Rivermc

With this task, you can easily cope with dropbox, synchronizing files on all machines. Free only 2GB is enough for sites

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question