Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

gitbox

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://[email protected]/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://[email protected]/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?

like image 430
Samuel Fullman Avatar asked Mar 19 '23 05:03

Samuel Fullman


1 Answers

Try this:

git clone https://[email protected]/myrepo.git .

note the trailing ..

like image 198
Chris Avatar answered Mar 22 '23 10:03

Chris