Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloning git directly into web root public_html

Tags:

git

github

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?

like image 512
eoinoc Avatar asked Jun 04 '11 20:06

eoinoc


2 Answers

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

See this question for more details.

like image 179
Pascal Wittmann Avatar answered Oct 19 '22 11:10

Pascal Wittmann


Clone into cwd:

git clone git@github.com:example/myrepo.git .
like image 5
Andrew T Finnell Avatar answered Oct 19 '22 10:10

Andrew T Finnell