1
votes

I want to preserve the ".git" directory with all of it's content while executing synk ant task, but it deletes the content of .git directory.

<sync todir="${local.git.dir}" includeEmptyDirs="true">
    <fileset dir="${img.dir}"/>
    <preserveintarget>
        <include name=".git"/>
    </preserveintarget>
</sync>

Why according to this syntax, synk deletes the content of the .git directory?

This synk task should copy the file f1 (dir="${img.dir}") into the directory dir1 (todir="${local.git.dir}"); dir1 contains the directory .git.

Synk task doesn't delete the content of the .git directory only if I mention to put the file f1 into the directory dir1/target. In this case I will have this structure:

  • dir1 contains the directories: .git and target
  • the file f1 is copied into the target directory (which I don't want)

I want dir1 to contain .git and f1.

1

1 Answers

1
votes

I found the problem. I didn't specified to preserve the files in the .git.

By appending /** to .git I resolved the problem: <include name=".git/**"/> instead of <include name=".git"/>