gitgitbox

Clone a Git repo into the current folder (not a new subfolder)


FYI I am running MAMP on OSX. The remote repo is fine. I have cleared out the .git folder and .gitignore file from my local directory however as I was having problems with it. Here is the problem I currently face:

  1. If I do git init in my local folder, then later add the pointer to the original master, it will not synch up - takes for ever and just hangs.

  2. If I do git clone https://me@bitbucket.org/myrepo.git then it creates the git repo in a subfolder of the same name - not what I want.

  3. If I do git clone https://me@bitbucket.org/myrepo.git in the parent folder (above myrepo) then it tells me it can't because destination path 'myrepo' already exists and is not empty.

How do I use git to say "hey, rebuild the .git and .gitignore file into THIS FOLDER, and let's start over again?


Solution

  • Try this:

    git clone https://me@bitbucket.org/myrepo.git .
    

    note the trailing ..