1

Example: Git Repository abc.git contains tracked files abc-home.txt and abc-artifact.img

When I do git clone I get the files and git creates a .git directory with the meta information. Can I ask git to give me just the files without the meta information?

clarification Edit: I'm pulling from a remote bare repo.

fir3x
  • 157
  • 11

1 Answers1

2

You can use git archive and extract it immediately using tar:

git archive <branch-name> | tar -xC ./extract-here

Or if you're fine with an archive, you can create a zip of your repository:

git archive --format zip --output <repository.zip> <branch-name>

If you don't have a clone of repository locally, just add option --remote=<repository-url> to the git archive command.

David Ferenczy Rogožan
  • 23,966
  • 9
  • 79
  • 68