Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete or change directory of a cloned git repository on a local computer

Used git clone [url] to clone an open source project but it cloned to the

C:\Documents and Setings\$USER\project

What I wanted to do is clone the project to C:\project. I don't want to have duplicate project clones on my local machine.

How do I go about moving it to that location or deleting the existing repository(hopefully that's a correct term) and cloning it again?

I assume after deleting I should use something like the following to clone it to the desired location?

$ git clone [url] C:\project

like image 550
GitNewb Avatar asked Apr 14 '11 17:04

GitNewb


People also ask

How do I change directory in git clone?

If you are in the directory you want the contents of the git repository dumped to, run: git clone [email protected]:origin . The "." at the end specifies the current folder as the checkout folder. Save this answer.

How do I delete a cloned GitHub repository desktop?

On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under Danger Zone, click Delete this repository.

How do you delete a directory in git?

Browse to the directory in the repository and branch that you want to delete. In the top-right corner, click "…", and then Delete directory.

How do I change to the local directory where I want to clone my repository?

Go to the current directory where you want the cloned directory to be added. To do this, input cd and add your folder location. You can add the folder location by dragging the folder to Git bash. Click on “Clone or download” and copy the URL.


1 Answers

Just move it :)

command line :

move "C:\Documents and Setings\$USER\project" C:\project 

or just drag the folder in explorer.

Git won't care where it is - all the metadata for the repository is inside a folder called .git inside your project folder.

like image 174
deanWombourne Avatar answered Sep 19 '22 13:09

deanWombourne