I am trying to find a way to clone all my repositories automatically. However I am not able to find an acceptable way to do the clone. I am writing a C# Console application and the only thing I have managed to get working is using git clone through Powershell using an app-password. However I do not like the idea of exposing my username and password in the url, https://<username>:<app password>@bitbucket.org....
I would rather use a rest api where I can add the credentials in a authentication header. However I am not able to find anything on clone in the REST API documentation. What I have tried so far beside this:
- git commands using ssh but the request of a passphrase every time is stopping me from doing it automatically.
- Using the lib LibGit2Sharp but I cannot get it to handle long paths over 260 characters
- Access token and refresh token is a way I cannot see how I could automate from a console app since the tokens will expire in between backup runs.
The solution needs to be fully self sufficient. Is there a way to do that?