S.Magnaschi
S.Magnaschi

Reputation: 787

GIT: How to export all locally ignored files to other directory?

Is there a command a way or a script that can let me export all the ignored git directories and files in my .gitignore file to a folder of my choice preserving the directory structure?

I can get the whole list using this command:

git ls-files -i --exclude-from=[PATH_TO_GITIGNORE_FILE] -o

But I wasn't able to figure out how to do a mass export on a folder of my choice.

Upvotes: 1

Views: 159

Answers (1)

mockinterface
mockinterface

Reputation: 14880

You can of course use tar. Since you generate the list of files already, see this question: How can I build a tar from stdin? on constructing an archive from the file list.

Upvotes: 3

Related Questions