Nelly Junior
Nelly Junior

Reputation: 566

ant sync task deletes the directory mentioned to preserve

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:

I want dir1 to contain .git and f1.

Upvotes: 1

Views: 156

Answers (1)

Nelly Junior
Nelly Junior

Reputation: 566

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"/>

Upvotes: 1

Related Questions