libgit2 / libgit2/pygit2

GitError: local push doesn't (yet) support pushing to non-bare repos.

Open
#1,306 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

Description

I have changed a submodule and want to update the repository of this submodule.

    remote = 'origin'
    remote = repo.remotes[remote] 
    repo.config.get_global_config()['safe.directory'] = remote.url  
    res = remote.push(['refs/heads/temp'])

But I get an error: _pygit2.GitError: local push doesn't (yet) support pushing to non-bare repos.
At the same time, the console cmd is working: git push origin temp
How can I solve this problem via pygit2?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the remote.push(['refs/heads/temp']) call against a non-bare repository and compare it with the working git push origin temp command. Trace where pygit2 reports that local pushes to non-bare repositories are unsupported; done means establishing supported behavior or a documented pygit2 solution for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.