user3147268
user3147268

Reputation: 1884

Does git keep information about deleted remote branches in ./git

Imagine a company hosts their own git server (e.g. with Gitlab). A hosted repository on this server would usually points to a remote branch whose location contains the address of the server. Now the company decides to open source this repo on Github, but the other repos remain closed source.

Does Git delete every evidence of existence of the company's git server if they delete all remote branches and add only that from Github?

If I would run git remote -v I should only see the remote server on Github. But could logs or other files in ./git still reference to the old remote?

Upvotes: 1

Views: 82

Answers (1)

Kristján
Kristján

Reputation: 18813

Git remotes are only stored in your local configuration, so remotes like GitHub or your GitLab server will never have any knowledge of each other. In other words, if I clone your newly open-sourced repository from GitHub, I won't inherit any of your other remotes, either old or current.

That said, you should consider starting an entirely fresh repository and dropping the current code into the first commit. It would be nice to maintain the project's history so far, but that history could contain private company data, credentials, curse words, etc. that's going to be difficult to find and scrub out.

Upvotes: 4

Related Questions