Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disconnect a local Git repository from remote master

Tags:

git

How do I completely disconnect a local Git repository from all remote branches?

I cloned a Git repository from github.com, but then it was deleted and I don't want Git to report any changes needing to be "pushed up". I've tried googling this, but I think my terminology is wrong, and I'm not finding anything.

Can I simply delete the [remote "origin"] and [branch "master"] sections from my .git/config file or will that break my local repository?

like image 965
Cerin Avatar asked Apr 11 '15 22:04

Cerin


People also ask

How do I remove a local repository from a remote?

by running "git remote rm origin", you will just remove the connection from your repo to the remote origin without losing all history, branches, tags and stashes you had locally.. It would then for example be possible to connect to a different (ideally empty) remote and push everything to that one..

How do I unlink a local directory in git?

Use rm -r switch with the git command to remove directory recursively. After removing the directory you need to commit changes to the local git repository. Then push the changes to remove the directory from the remote git repository.


1 Answers

git remote rm origin should work.

like image 67
helion3 Avatar answered Oct 03 '22 19:10

helion3