4

I'm trying to archive a folder in my git repository:

git archive --format=tar HEAD:mydir/ | tar t

However, the error message I'm getting is:

fatal: current working directory is untracked

The instructions I followed were here.

My git version is: 2.1.2

A google search only came up with 6 links, all of them a few years old and didn't look relevant.

Community
  • 1
  • 1
Chris Snow
  • 23,813
  • 35
  • 144
  • 309

1 Answers1

4

The solution was:

cd $myrepo/mydir
git archive --format=tar  HEAD ./ | tar t
Chris Snow
  • 23,813
  • 35
  • 144
  • 309
  • 1
    Yeah, I too thought that the path after the colon in `HEAD:` actually is a full path from the git root, turns out it is relative to current location, then... (but only when the colon is not used, as you've posted it) – sdbbs Jan 27 '17 at 10:37