To clone git repository into a specific folder, you can use -C <path>
parameter, e.g.
git -C /httpdocs clone git@github.com:whatever
Although it'll still create a whatever
folder on top of it, so to clone the content of the repository into current directory, use the following syntax:
cd /httpdocsgit clone git@github.com:whatever .
Note that cloning into an existing directory is only allowed when the directory is empty.
Since you're cloning into folder that is accessible for public, consider separating your Git repository from your working tree by using --separate-git-dir=<git dir>
or exclude .git
folder in your web server configuration (e.g. in .htaccess
file).