I have a private Microsoft Azure-Devops/TFS Pipeline. This pipeline builds my code and also mirrors it's content to a public github repository.
Now I'd like the pipeline to not mirror some folders, since I want to keep these folders private. I can't just change the git-ignore files and I fail to build a script that deletes the folder before commiting it to github.
So how do I handle this type of problem? Is there any way to pull-push a repository, excluding one specific folder, without the gitignore?
- task: CmdLine@2
inputs:
script: 'git pull https://$(githubpersonaltoken)@github.com/MyRepo/MyFile.git master'
- task: DeleteFiles@1
displayName: 'Delete folder'
inputs:
SourceFolder:
Contents: '.deletedFolderName*'
RemoveSourceFolder: true
- task: CmdLine@2
inputs:
script: 'git push https://$(githubpersonaltoken)@github.com/MyRepo/MyFile.git head:master'
Expected result: Changes in "deletedFolderName" would not be mirrored by the push task. Result: Everything is pushed.