Install credentials for the first time (libgit2)

Therefore, I use some libgit2 functions to connect to a remote device and perform push git. I want to click on a private repository, so I need to set credentials.

But, for example, when I work with private repositories through git commands, and I want to connect to this repository for the first time, I enter the credentials ... but after that, if I want to click a second, third time or so, I I don’t need to write these credentials again, also when I restart the computer. It seems to me that there is a place where "known repositories" are stored with their credentials.

And my question is: is there a way to do this with libgit2? I mean, is there a way to click on "known" private remote repositories without setting credentials? “Famous” means the repositories I've already worked with, so I already set the credentials

I want to work with many different repositories, each of these repositories has its own credentials, so I do not want to set credentials every time every time I click.

When I push without setting credentials (click on the "known" repo), this error message is displayed

Request failed with status code: 401

So there is a way, how not to set credentials every time I click?

0
source share
1 answer

git , API- . , Keychain Mac, Windows Credential Manager Windows gnome-keyring libsecret Linux. . git.

Libgit2 . , . API- , libgit2 .

+1

Source: https://habr.com/ru/post/1687816/


All Articles