【问题标题】:How to push specific branch to ftp server with git-ftp如何使用 git-ftp 将特定分支推送到 ftp 服务器
【发布时间】:2015-10-04 04:01:21
【问题描述】:

上下文

我正在使用git-ftp 将我的 git 文件上传到我的 ftp 服务器。在 git 中,我有 2 个分支:developmentproduction。当我想上传development 分支时,我提交、推送然后使用命令上传:

git ftp push --user <user> --passwd <passwd> <ftp-server>/development

问题

假设我想将我的production 分支推送到我服务器的production 文件夹中,我如何告诉 git-ftp 我要推送的是这个分支,而不是我的开发分支?我在man 中找不到该选项。示例:

git ftp push --user <user> --passwd <passwd> <ftp-server>/production --branch production

【问题讨论】:

    标签: git ftp git-branch git-push git-ftp


    【解决方案1】:

    参考 git-ftp 作用域

    https://github.com/git-ftp/git-ftp/blob/master/man/git-ftp.1.md

    有一个如何配置生产/测试环境的示例

    $ git config git-ftp.testing.url ftp.testing.com:8080/foobar-path
    $ git config git-ftp.testing.password simp3l
    
    $ git config git-ftp.production.user manager
    $ git config git-ftp.production.url live.example.com
    

    你应该使用

    git ftp push -s production --branch production
    

    【讨论】:

      【解决方案2】:

      据我了解 - git-ftp 仅适用于文件状态(文件本身) - 不适用于 git 分支,因此您的网络切换/结帐以推送与某些 git-ftp 范围相关的所需数据)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-06-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-08-18
        • 1970-01-01
        • 1970-01-01
        • 2013-10-09
        相关资源
        最近更新 更多