Skip to content

How to make authenticated clones/fetches #816

Answered by Byron
rsdy asked this question in Q&A
Discussion options

You must be logged in to vote

Alright, if you look at the latest main you will find some (breaking) changes to support controlling the authentication when cloning.

It works like this (even though I didn't try to compile this code):

use gix::{
    credentials::{helper::NextAction, protocol::Outcome},
    remote::{Connection, Direction},
    sec::identity::Account,
};

#[tokio::main]
async fn main() {
    let token = "github_personal_token";
    let clone = gix::prepare_clone_bare("https://github.com/user/private_repository", "/path/to/clone").unwrap();

    _ = clone
        .configure_connection(|con| {
            con
                .set_credentials(|action| match action {
                    gix::credentials::helper::

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@Byron
Comment options

@rsdy
Comment options

@Byron
Comment options

@Byron
Comment options

Answer selected by Byron
@rsdy
Comment options

@Byron
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #815 on April 18, 2023 17:18.