7

Using github, when I clone a repository it creates a subfolder with the name of the repository.

For example, if I do the following command in my web root:

git clone git@github.com:exampl/myrepo.git

...then there is a folder public_html/myrepo/

How do I approach cloning it directly into the root of public_html without the subfolder being created?

Moreover, is this the best approach for deploying, or should I be creating a symlink, for example?

eoinoc
  • 3,155
  • 3
  • 24
  • 39

2 Answers2

11
git clone git@github.com:foo/bar .

See this question for more details.

Community
  • 1
  • 1
Pascal Wittmann
  • 344
  • 1
  • 9
5

Clone into cwd:

git clone git@github.com:example/myrepo.git .
Andrew T Finnell
  • 13,417
  • 3
  • 33
  • 49