How to remove git cache on local computer

Used by git clone [url] to clone an open source project, but it clones to

C:\Documents and Setings\$USER\project

I wanted to clone a project C:\project . I do not want to duplicate the project clone on my local machine.

How do I move it to this place or delete an existing repository (hopefully the right term) and clone it again?

I assume that after removal I should use something like the following to clone it to the right place?

$ git clone [url] C:\project

+45
git windows-xp move
Apr 14 2018-11-11T00:
source share
5 answers

Just move it :)

:

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

or just drag and drop the folder in explorer.

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

+54
Apr 14 '11 at 17:24
source share

You can simply delete the directory where you cloned the repo and re-clone it wherever you want.

+19
Apr 14 '11 at 17:24
source share

I assume you are using Windows and GitBASH.

You can simply delete the "C: ... \ project" folder without any side effects.

Then in git bash you can do cd c\: This changes the directory you are working in to C: \

Then you can do git clone [url] This will create a folder called "project" in C: \ with the contents of the repo.

If you want to call it something else, you can do git clone [url] [something else]

For example, cd c\:
git clone git@github.com:username\repo.git MyRepo

This will create a folder in the folder "C: \ MyRepo" with the contents of the remote repository.

+5
Apr 14 2018-11-11T00:
source share

You can try this via SSH: rm -rf foldernamehere

+3
May 25 '14 at 16:21
source share
  • Change to the working directory where the project folder is located (cloned folder).
  • Now delete the folder.
  • in windows just right click and delete.
  • at the command line use rm -r "folder name"
  • it worked for me
0
Oct 26 '17 at 6:30
source share



All Articles