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

Viewed 792

My project uses git to source on bitbuckets and git-ftp to deploy the build on an FTP.

I want to:

  • not track the build in the source file
  • not track the source file on the ftp
  • track only the build folder on the ftp

By now I have:

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

But the command git ftp push return an message

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

Here is what I did

In bitbucket-pipelines.yml file

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

!./build
Related