Home > Blockchain >  How to remove "master" next to directory path?
How to remove "master" next to directory path?

Time:09-05

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.

(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!

CodePudding user response:

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/)

  •  Tags:  
  • git
  • Related