Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to remove repository from local without removing it from remote?

Douglas Pope November 4, 2016

Because my development machine has a tiny drive, I need to conserve drive space whenever I can.  Is there any way to remove a local repository that I am not currently using from the local drive without removing it from the remote site (I'm using GitLab, so I don't want to remove it from GitLab, only from my local machine)?  Thanks!

2 answers

5 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 4, 2016

Just delete the repository locally, it will not affect your remote repository. Just make sure that before you delete it, that you have pushed all your commits to the remote. In SourceTree you just right-click on the repository bookmark and delete it, and it will ask if you want to delete just the bookmark or also the repository. Note that it will leave the .git directory, so you will have to manually remove that.

Ikthedar Chowdhury July 10, 2020

Unfortunately I don't see any Bookmark option in my SourceTree.

Like Calichin53 likes this
Bharadwaj.Gorthy October 6, 2020

It is the option to the top right corner on sourcetree. Click on it and you would see a list of repositories on your local machine and once you right click on the one that you want to delete and you would find an option

Capture.JPG

Like tombys likes this
Mamatweli Turdy June 15, 2021

Hello:

 

While I was trying to import the repo to Eclipse, had the same issue, searching online came across this post. downloaded SourceTree, I thought I was deleting the one causing the issue, now it seems like I deleted everything else but the troubled branch. 

 

Is there a way to get it back? 

If someone can help me with this, I'd really appreciate it. 

 

Thank you so much!! 

0 votes
Alexander Pampushko November 4, 2016

Your local repository and your remote repository are equal.

You may delete local repository and this not make any change in you remote repository.

use git command for get remote repo,

add remote repo for your local repo

or delete link to your remote repo

git remote -v 
git remote add
git remote rm

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events