Skip to main content

configure_git_credential

Function configure_git_credential 

Source
pub(crate) fn configure_git_credential(
    api: &str,
    auth_file: &str,
) -> Option<String>
Expand description

Points git at the token for one node, and returns the file it wrote.

Scoped to the node’s origin with credential.<origin>.helper rather than set as the bare credential.helper, so this cannot answer for GitHub or for anybody else’s server: a helper configured unscoped is asked about every host git ever talks to.

It goes in ~/.gitconfig because that is the only config a clone that does not exist yet will read, and the whole point is that the next git clone works. None when git could not be run or refused, which is reported rather than fatal — the join itself succeeded, and the line to run by hand is printed instead.