libgit2sharp repository credentials2020-02-15 c# vb.net git libgit2sharp
I'm using LibGit2Sharp to clone a repository into a local folder. I know I could simply use Brute Force and delete the .git folder afterwards, and that will certainly achieve what I set out to achieve, but it's not the most elegant way to address this. If I deleted the .git folder I would have to clone it again at a later stage. I want to easily "switch" between branches but it becomes a slow and laborious process if every time I have to re-clone it before I can do that.
What I would like to do is to, after Cloning the repository, .... and here is where I don't know the correct terminology. what.... "log out"? "disconnect the credentials"? I don't know. Basically, what I want to achieve is that after the Clone a user cannot simply go and start messing about with the files and Push them back up to the remote repository, but I can't find any clear answers online about how to "clear credentials". I'm looking to do so programmatically, obviously.
Sorry. As this isn't clear in my own head I don't know how to ask this properly. I hope I described it clearly enough for someone to know how to answer this.
Answers in C# or VB.NET welcome ...
- Find and restore a deleted file in a Git repository
- How can I determine the URL that a local Git repository was originally cloned from?
- How do I update a GitHub forked repository?
- How to change the URI (URL) for a remote Git repository?
- How do I push a new local branch to a remote Git repository and track it too?
- How do I revert a Git repository to a previous commit?
- Reset local repository branch to be just like remote repository HEAD
- How can I add an empty directory to a Git repository?
- Throw away local commits in Git
- Remove a file from a Git repository without deleting it from the local filesystem