How to disconnect a local Git repository from remote master
GitGit Problem Overview
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?
Git Solutions
Solution 1 - Git
git remote rm origin
should work.
Solution 2 - Git
This works:
To remove a remote:
git remote remove origin
To add a remote:
git remote add origin yourRemoteUrl
& then git push -u origin master
Solution 3 - Git
If you remove the .git folder, it will disconnect your local repo from the remote.
rm -rf path/to/local_repo/.git