What does tree-ish mean in Git?

Viewed 49091

I'm very confused about how to use git archive.

I have a git repository with folder Foo, Bar and Baz at the top level. I need to export folder Foo in a SVN-ish sort of way for quick test deployment.

I learned that I could use git-archive in an SVN-ish export sort of way.

But here's the thing, The following works fine:

git archive master | tar -x -C ~/destination

it results in Foo, Bar, Baz folders in the destination folder.

However, the following will error out with fatal not a valid object name:

git archive master/foo | tar -x -C ~/destination

The Documentation

Looking as the synopsis for the git archive program I see that it can take a <tree-ish> [path] as a parameter (synopsis summarized to relevant parts):

git archive <tree-ish> [path...]

If master/foo is not tree-ish, then what is?

6 Answers

From Git Glossary tree-ish is "A tree object or an object that can be recursively dereferenced to a tree object." commit, HEAD and tag are examples of tree-ish objects.

Related