简体   繁体   English

Git ftp:如何在 .gitignore 中忽略“build”文件夹时上传它?

[英]Git ftp: How to upload the "build" folder while it is ignored in .gitignore?

My project uses git to source on bitbuckets and git-ftp to deploy the build on an FTP.我的项目使用git在 bitbuckets 上获取源代码,并使用git-ftpgit-ftp上部署构建。

I want to:我想要:

  • not track the build in the source file不跟踪源文件中的构建
  • not track the source file on the ftp不跟踪 ftp 上的源文件
  • track only the build folder on the ftp仅跟踪 ftp 上的build文件夹

By now I have:现在我有:

  • In .gitignore : build.gitignorebuild
  • In .git-ftp-ignore : *.git-ftp-ignore*
  • In .git-ftp-include : build/*.git-ftp-includebuild/*

But the command git ftp push return an message但是命令git ftp push返回一条消息

There are no files to sync.
Last deployment changed from  to b0d3d2797796a0bc3c47d0aa128a3abc4cbef9e5.

Here is what I did这是我所做的

In bitbucket-pipelines.yml filebitbucket-pipelines.yml文件中

image: node:10.15.3
pipelines:
  default:
    - step:
        caches:
        - node
        name: Installing
        script:
          - npm install
          - npm run build   
          - apt-get update
          - apt-get -qq install git-ftp
          - git ftp push --syncroot ./build --user $FTP_USERNAME --passwd $FTP_PASSWORD $FTP_SERVER

And then added a .git-ftp-include file which only contains然后添加了一个.git-ftp-include文件,其中只包含

!./build

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM