I would like to know if there is an easy way to push a GIT repository into production (on a FTP server) ? Thanks
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
You can try FTPloy ...
https://ftploy.com
You have one free project to try it out with. I am currently using for a small php website and it works quite well. A few bugs on the site but its an active project so at least they are working on it.
If you are putting code into production, I recommend using an "installer" such as an RPM package to install your code. That way it will be version stamped and you will be able to leverage the installer package to support updates to the production code. Git is not really designed to support production installations, it is intended to track changes to the code itself.
In any event, with an .RPM (or EXE or whatever) built, you can just FTP it to the production system and install it like any other package.
There's a Ruby script here - Ruby git-deploy via FTP or SSH which uploads only the changed files in the git repo via FTP or SSH.
As mentioned in another answer, here is the Python git-ftp.py script which does a similar thing.
And here is the shell script version of git-ftp.
There is also a Ruby gem project called git-deploy which lets you setup a custom deploy via a git remote using the
git push
command, in the same way as the Heroku and Azure services. For this one you may need to write custom methods to deploy via FTP and I think it assumes you have SSH access to your production server.If you're on a mac and have Transmit, I'd recommend the following git-tranmit script (https://gist.github.com/379750). It uses DockSend to send only the last updated files. If you're not familiar with DockSend, check out http://www.panic.com/blog/2010/11/15-secrets-of-transmit/.
Setup:
I've found PHPloy a great tool for sending your Git commits to remote servers over FTP. It works from the command-line and is written in PHP (and even detects changes in submodules).
https://github.com/banago/PHPloy
Done!
(Disclaimer: after using it for a while I've now contributed some code patches and improvements, making it Windows-compatible.)
I was struggling a lot to figure out this. I have figured out an easy way to get this done from various sources (git-ftpINSTALL, git-ftpUPLOAD, git-ftpIssue, git-ftpPUSH). You can read for reference but there is no need because I have mentioned step by step process below.
First thing first: Install git and curl using brew on MAC OS
Run the following commands:
Updating using git
Setup
Upload all files
Or if the files are already there
Work and deploy
If there is an error: pathspec 'index.txt' did not match any file(s) known to git. It means the file hasn't been staged yet, so add the file and then try commit.
Hope this helps.