如何使用 git-ftp 设置存储库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20398565/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:25:36  来源:igfitidea点击:

How to set up a repository using git-ftp?

gitftpgit-ftp

提问by Naghi Attila

I'm a newbie so please explain how to set up a repository?
I installed git-ftp.
I tried : git ftp init -u my_User-p my_Pass - ftp://host.example.com/public_html

我是新手,请解释如何设置存储库?
我安装了 git-ftp。
我试过 :git ftp init -u my_User-p my_Pass - ftp://host.example.com/public_html

but I got this error message :

但我收到此错误消息:

fatal : Not a git repository (or any of the parent directories): .git
fatal : Not a Git project? Existing ....

致命:不是 git 存储库(或任何父目录): .git
致命:不是 Git 项目?现存的 ....

terminal screenshot

终端截图

回答by Ricardo Souza

You have to setup a git repositor first:

您必须先设置一个 git 存储库:

Enter your Project directory:

输入您的项目目录:

cd my/Project/

Init a git repository on it:

在其上初始化一个 git 存储库:

git init
git add .
git commit -m "Initial commit"

Configure you FTP:

配置您的 FTP:

git config git-ftp.user demouser
git config git-ftp.url ftp.example.com/demofolder
git config git-ftp.password demopassword

Init the git-ftp client:

初始化 git-ftp 客户端:

git ftp init

Push your changes to FTP:

将您的更改推送到 FTP:

git ftp push

Make your changes and commit:

进行更改并提交:

git add someFile.html
git commit -m "Added someFile.html"

Push your changes again and only what have changed is pushed:

再次推送您的更改,只推送更改的内容:

git ftp push

That's it.

就是这样。

回答by Mark Ma

I found a ftp git tool which is much easier to use: Ftp-Git. It's a GUI ftp deployment tool which can push changed files in git repository to your ftp server. (All in a GUI way)

我找到了一个更容易使用的 ftp git 工具:Ftp-Git。它是一个 GUI ftp 部署工具,可以将 git 存储库中更改的文件推送到您的 ftp 服务器。(全部以 GUI 方式)

回答by kds

I think you have not init a local git repository, into which this remote is supposed to be added?

我认为你没有初始化一个本地 git 存储库,这个远程应该被添加到其中?

Does your local directory have a .git folder?

您的本地目录是否有 .git 文件夹?

Try git init

尝试 git init

回答by jannej

If you are on macOS, take a look a GitFTP-Deploy.

如果您使用的是macOS,请查看 GitFTP-Deploy。

(Disclaimer: I am the creator of this app. Developed it for satisfying my own itch)

(免责声明:我是这个应用程序的创造者。开发它是为了满足我自己的痒)