Being new to the git/github process, I managed to so completly mangle my local repo that I deleted it entirely from my hard drive because I doubted my ability to use git to recover the repo from GitHub. I did a dir command in the terminal and got the message "Cannot find path "; so it is not accessible at all as a local git repo. I want to re-establish the local repo. There is a remote repo on GitHub.
Will a simple Copy/Paste work here? By inference, I think this is NOT the case but that I must follow the git/github command protocol to make this happen using git on my Windows PowerShell terminal to make this happen.
I believe the remote GH repo is intact because I didn't make any commits to it other than the intial one to establish it, although I did create and edit a README.md file using GitHub facilities. Can I "retrieve" the GH repo and put it on my local system? If so, how do I proceed?
My *guess *is I first have to make a directory on my system (locally) and do a git init to create a space/staging_area for the repo. If I'm correct in this assumption and I do need to recreate the file directory structure on the local system, can I create just the root folder or do I have to create the directory tree exactly the same as the GitHub repo? After setting up a space to contain the retrieved GH repo - again guessing here, what git commands will have to be executed locally that will address and link to the remote repo and cause it to be "downloaded" into a local git repo. I need instructions on how to do this, with the understanding that I have NO LOCAL REPO at all.
Am I over thinking the process?
I have not tried to do anything since deleting the files from my local hard drive other than to search online and get confused by answers I found there.
Am I over thinking the process?
I think so.
Just go to the parent directory of the one where you want the repo to be (because the clone operation will create the repo directory itself), and use git clone
, taking the clone URL from the green "Code" button on GitHub (just click on the button, then click on the overlapping squares to the right of the HTTP URL). Type git clone
and then paste, so you end up with something like:
git clone https://github.com/nodatime/nodatime.git
That create a directory for the repo beneath the current directory (e.g. it would create a nodatime
directory in this case).