Skip to content

Authentication Error: Authentication Required #489

@Manjinder096

Description

@Manjinder096

Trying to clone a repo using go-git, below is the code that I wrote. I'm using BasicAuth from provided "http" package in go-git.

r, err := git.PlainClone(directory, false, &git.CloneOptions{
		Auth: &http.BasicAuth{
			Username: username,
			Password: password,
		},
		URL:      url,
		Progress: os.Stdout,
	})

Also tried using in-memory clone but it also gives same error :

r, err := git.Clone(storer, fs, &git.CloneOptions{
		URL:  repository,
		Auth: &http.BasicAuth{
			Username: username,
			Password: password,
		},
	})

the error simply says "authentication required" . This is the same method all official examples are also following. Not sure if I am missing anything here ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions