Travis Northcutt
Travis Northcutt

Reputation: 25036

Cloning a git repository creates a subdirectory where it is cloned to - why?

I have a git repository setup at C:\xampp\htdocs\wordpress.

I'd like to clone it at for instance C:\xampp\htdocs\newsite. When I'm in \newsite in Git Bash and run git clone C:\xampp\htdocs\wordpress\, I end up with C:\xampp\htdocs\newsite\wordpress, when I'd like to have the contents of \wordpress in \newsite. Is that possible, or am I incorrect in thinking that should be the result?

More information: my intention is to have a plain WordPress install that I can easily clone (the filesystem portion, anyway) to create a new site from. I won't need to have further interaction between the two repositories. Is there a better way to accomplish this than what I'm describing above?

Upvotes: 2

Views: 374

Answers (1)

alex
alex

Reputation: 490273

If the folder is empty, you can use . to clone it into the working directory.

git clone C:\xampp\htdocs\wordpress\ .

Or you could go up one directory (cd ..) and give it the name newsite.

git clone C:\xampp\htdocs\wordpress\ newsite

Upvotes: 3

Related Questions