Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Push with HTTPS : receive-pack not supported yet #406

Closed
se0wtf opened this issue May 30, 2017 · 1 comment
Closed

Push with HTTPS : receive-pack not supported yet #406

se0wtf opened this issue May 30, 2017 · 1 comment
Assignees

Comments

@se0wtf
Copy link

se0wtf commented May 30, 2017

Hello,
I'm trying to use go-git to clone/add/commit/push with HTTPS (not ssh).
I have no problem with the clone/add/commit but when i try to push i get the following error : error: receive-pack not supported yet

This is the pseudo-code i use :

import (
	"gopkg.in/src-d/go-git.v4"
	"gopkg.in/src-d/go-git.v4/plumbing/object"
	githttp "gopkg.in/src-d/go-git.v4/plumbing/transport/http"
)

httpAuth := githttp.NewBasicAuth("user", "password")
r, err := git.PlainClone(tmpGitDir, false, &git.CloneOptions{
	URL:      "https://gitlab/test.git",
	Progress: os.Stdout,
	Auth:     httpAuth,
})
CheckIfError(err)

w, err := r.Worktree()
CheckIfError(err)

_, err = w.Add("file.txt")
CheckIfError(err)

_, err := w.Commit("example go-git commit", &git.CommitOptions{
	Author: &object.Signature{
		Name:  "User test",
		Email: "[email protected]",
		When:  time.Now(),
	},
})
CheckIfError(err)

log.Print("we push")
err = r.Push(&git.PushOptions{Auth: httpAuth})
CheckIfError(err)

Everything works fine except the push.
If i don't use the httpAuth on the push i get the same error.
If i try the command "git http-push ..." directly from the bash, it works fine.

Any idea ?
Thanks ;)

@smola
Copy link
Collaborator

smola commented Jun 1, 2017

@se0wtf Push is still not supported on HTTP(S), only on git://, file:// and ssh://.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants