Skip to content

Cloning with personal access token causing "remote: invalid credentials". #936

Open
@Malte0621

Description

@Malte0621

Code:

const git = simpleGit.simpleGit({
  baseDir: localPath,
  binary: "git",
  maxConcurrentProcesses: 6,
  config: [
    `http.extraHeader=Authorization: Bearer ${TOKEN}`,
  ],
});

git
.clone(cloneURL, localPath)
.then(() => {
  returnPromise(true);
})
.catch((err) => {
  console.error(err);
  returnPromise(false);
});

Issue:

After running the code a github credentials prompt pops up, every time.. Even tho the token is provided in the config.
image
Upon closing OR filling in the prompt, the following shows:
image

I just recently created the token, with access to all of my repositories (read-only).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions