Jump to content

Unlink git

Go to solution Solved by colonel_mortis,

Just deleting the folder is fine (or if you want to keep the code, just not have it be a git repo, then you can just delete the hidden .git folder inside) - git keeps all of the relevant metadata in there. (You don't necessarily even need to delete it - cloning a repo is essentially just downloading the contents, and git doesn't do automatic background synchronization or anything like that, so other than a few kB of metadata there's not really any cost to leaving it around.)

 

1 hour ago, stefanmz said:

Also I noticed when I cloned it, it said the server that I used for that was added to my trusted servers list or something like that? Does that mean my MacBook has a link to the server and how do I unlink it? If it doesn't have a link then how do I remove the server from my trusted servers and also should I actually do that? Do I need to do that or do I need to just clear the folder?

The trusted servers are stored in ~/.ssh/known_hosts. The only thing it means is that if you ever connect to that server again (via SSH or git-over-SSH) you won't be prompted to verify the server key, so there's definitely no need to clean that up. If you really want to, you can edit that file to remove the corresponding entry.

1 hour ago, stefanmz said:

Also I remember making an SSH key for pantheon for the Git. How do I delete that and remove it from there? 

If you only created the SSH key for git, not for actually SSHing into servers, then it would be safe to delete, although again not necessary to do so. It should be stored in two parts in ~/.ssh, probably called id_rsa and id_rsa.pub (although it could also be id_ecdsa and id_ecdsa.pub, or any other name). If you're absolutely sure that you didn't use that key for anything else, you can delete both those files.

 

On the git server side, there should be a place in the server's configuration where you added your public key (unless you were just cloning a public repo, in which case you may not have needed to configure that) - you should be able to delete your public key from that config.

Hi! So I cloned the git repository of my website on pantheon. And I now decided to use SMTP instead of GIT because it's simpler to install modules. So now I need to remove the cloned git repository. How do I do that? Do I just delete the folder on my MacBook that contains the repository? Is there some way to unclone it and remove it in a  specific way or is it just trash the folder? Also I noticed when I cloned it, it said the server that I used for that was added to my trusted servers list or something like that? Does that mean my MacBook has a link to the server and how do I unlink it? If it doesn't have a link then how do I remove the server from my trusted servers and also should I actually do that? Do I need to do that or do I need to just clear the folder? I am confused. Also I remember making an SSH key for pantheon for the Git. How do I delete that and remove it from there? 

Link to comment
Share on other sites

Link to post
Share on other sites

Just deleting the folder is fine (or if you want to keep the code, just not have it be a git repo, then you can just delete the hidden .git folder inside) - git keeps all of the relevant metadata in there. (You don't necessarily even need to delete it - cloning a repo is essentially just downloading the contents, and git doesn't do automatic background synchronization or anything like that, so other than a few kB of metadata there's not really any cost to leaving it around.)

 

1 hour ago, stefanmz said:

Also I noticed when I cloned it, it said the server that I used for that was added to my trusted servers list or something like that? Does that mean my MacBook has a link to the server and how do I unlink it? If it doesn't have a link then how do I remove the server from my trusted servers and also should I actually do that? Do I need to do that or do I need to just clear the folder?

The trusted servers are stored in ~/.ssh/known_hosts. The only thing it means is that if you ever connect to that server again (via SSH or git-over-SSH) you won't be prompted to verify the server key, so there's definitely no need to clean that up. If you really want to, you can edit that file to remove the corresponding entry.

1 hour ago, stefanmz said:

Also I remember making an SSH key for pantheon for the Git. How do I delete that and remove it from there? 

If you only created the SSH key for git, not for actually SSHing into servers, then it would be safe to delete, although again not necessary to do so. It should be stored in two parts in ~/.ssh, probably called id_rsa and id_rsa.pub (although it could also be id_ecdsa and id_ecdsa.pub, or any other name). If you're absolutely sure that you didn't use that key for anything else, you can delete both those files.

 

On the git server side, there should be a place in the server's configuration where you added your public key (unless you were just cloning a public repo, in which case you may not have needed to configure that) - you should be able to delete your public key from that config.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/6/2022 at 2:00 AM, colonel_mortis said:

Just deleting the folder is fine (or if you want to keep the code, just not have it be a git repo, then you can just delete the hidden .git folder inside) - git keeps all of the relevant metadata in there. (You don't necessarily even need to delete it - cloning a repo is essentially just downloading the contents, and git doesn't do automatic background synchronization or anything like that, so other than a few kB of metadata there's not really any cost to leaving it around.)

 

The trusted servers are stored in ~/.ssh/known_hosts. The only thing it means is that if you ever connect to that server again (via SSH or git-over-SSH) you won't be prompted to verify the server key, so there's definitely no need to clean that up. If you really want to, you can edit that file to remove the corresponding entry.

If you only created the SSH key for git, not for actually SSHing into servers, then it would be safe to delete, although again not necessary to do so. It should be stored in two parts in ~/.ssh, probably called id_rsa and id_rsa.pub (although it could also be id_ecdsa and id_ecdsa.pub, or any other name). If you're absolutely sure that you didn't use that key for anything else, you can delete both those files.

 

On the git server side, there should be a place in the server's configuration where you added your public key (unless you were just cloning a public repo, in which case you may not have needed to configure that) - you should be able to delete your public key from that config.

ok thanks! That's a very informative and understandable answer! Thanks a lot! I will decide indeed if I need to do that.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×