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.

4
  • 1
    possible duplicate of cp command should ignore some files Commented Sep 25, 2015 at 12:34
  • @rajuGT No, that's definitely not a duplicate of the question you suggested. Commented Sep 25, 2015 at 12:44
  • possible duplicate of Do a "git export" (like "svn export")? Commented Sep 25, 2015 at 12:55
  • @fir3x Please consider marking some answer as an accepted answer, so others can more easily find a help, if this question won't be closed as a duplicate. Commented Sep 25, 2015 at 14:05

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.