Skip to content

Pushing a hash to a branch is not working? #105

@eelco

Description

@eelco

I’m trying to push a commit hash to a branch, this is a fairly common pattern for us (to do deployments):

        refSpecs := []config.RefSpec{
		config.RefSpec(fmt.Sprintf("%s:refs/heads/release/%s", commit.Hash, env)),
	}
	err = r.Push(&git.PushOptions{
		RemoteName: "origin",
		RefSpecs:   refSpecs,
        }

However, this results in an already up-to-date error, which is definitely not true. The equivalent command on the CLI works without problem, so I’m assuming it’s not the RefSpec that’s wrong 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