I am trying to effectively check out only a directory and its contents (a specific wordpress theme directory) inside a larger git repo hosted on Github on a server. The server has existing WordPress directories in it, and I want to place the new theme directory from the repo into the proper directory on the server. I first tried the approach described in an accepted answer to a similar question. When I ran the below line,
[scapa]$ git fetch git@github.com:mrengy/new-urban-arts.git
I got an error of:
fatal: Not a git repository (or any parent up to mount parent ) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
So I ran:
[scapa]$ git init
Initialized empty Git repository in /home/newurbanarts/stage.newurbanarts.org/.git/
[scapa]$ git remote add origin git@github.com:mrengy/new-urban-arts.git
Now when I run (as per the accepted answer):
[scapa]$ git fetch origin master
[scapa]$ git checkout origin/master -- wp-content/themes/newurbanarts
I get:
error: pathspec 'wp-content/themes/newurbanarts' did not match any file(s) known to git.
What am I doing wrong, and how do I get around this?