Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to remove "master" next to directory path?

This could be a silly question but I couldn’t find an answer anywhere.

I copied a repository from git.

(base) [~/Desktop]$ git clone https://github.com/me/myrepository

I wanted to disconnect it from git.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

(base) [master][~/Desktop/myrepository]$ git remote remove origin
(base) [master][~/Desktop/myrepository]$ git remote -v

git remote -v prints nothing, but "[master]" still exists. The thing is I copied it to a server computer and there it still shows "[master]". How do I remove it? I want to make it totally local. So none can change my git.

Thanks in advance!

>Solution :

Most probably that’s a branch name. If you want to completely "disconnect from git", just delete .git folder. This will remove ANY relation to git, including branches, history, tags, just everything. Ok, maybe some meta files like ".gitignore" and similar that sometimes are at the root folder will be left, btu that depends on whever you used them or not, you’ve to inspect it yourself to be 100% sure. Be warned though, when you delete .git, it’s gone. You will have to re-clone from the remote repo if you change your mind or ‘oops I wanted to add a file from a branch’ etc.

However, if you just want to remove connection to your remote repo, and leave branches/history/etc, then removing origin remote is only a good start, but there may be some other information about ‘origin’ still cached. For example, you may also want to check .git folder and see refs heads and remove any folders called origin as well.

Also, why not git archive instead? (https://alvinalexander.com/git/git-export-project-archive-cvs-svn-export/)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading